You are not logged in.

#1 2009-11-28 14:43:51

y27
Member
Registered: 2009-05-27
Posts: 147
Website

hc, hcg, and libmapm PKGBUILDs advice/testing

Hello,
I am writing a calculator - hc (cli version) and hcg (gui version) which require the MAPM library.
More information can be found here:
http://bbs.archlinux.org/viewtopic.php?id=85641

goran'agar and I wrote PKGBUILDs for these 3:

# Contributor: Fabio Comolli <fabio.comolli@gmail.com>
pkgname=mapm
pkgver=4.9.5
pkgrel=1
pkgdesc="Mike's Arbitrary Precision Math Library"
url="http://www.tc.umn.edu/~ringx004/mapm-main.html"
depends=('gcc')
provides=('mapm')
source=("http://www.tc.umn.edu/~ringx004/mapm-$pkgver.tar.gz")
md5sums=('a92ff86b6240f78f882661e0b1c11920')
license=('freeware')
arch=('i686' 'x86_64')

build() {
  cd $startdir/src/mapm_$pkgver
  gcc -c -Wall -O2 -fPIC map*.c || return 1
  gcc -shared -o libmapm.so.0 map*.o || return 1
  mkdir -p $startdir/pkg/usr/lib
  mkdir -p $startdir/pkg/usr/include
  mkdir -p $startdir/pkg/usr/share/mapm
  cp $startdir/src/mapm_$pkgver/libmapm.so.0 $startdir/pkg/usr/lib
  cp $startdir/src/mapm_$pkgver/m_apm*.h $startdir/pkg/usr/include
  cp -a $startdir/src/mapm_$pkgver/DOCS $startdir/pkg/usr/share/mapm
}
# Contributor: Fabio Comolli <fabio.comolli@gmail.com>
pkgname=hcg
pkgver=0.4.2
pkgrel=1
pkgdesc="HoubySoft Calculator - a calculator with lot of options and abundant functions"
url="http://hc.houbysoft.com"
depends=('mapm' 'gtk2' 'glib2')
provides=('hcg')
source=("http://houbysoft.com/download/$pkgname-$pkgver-src.tar.gz")
md5sums=('3c06c0d9e4ffb220a30820c733d55d1d')
license=('GPL 3')
arch=('i686' 'x86_64')

build() {
  cd  $startdir/src/$pkgname-$pkgver-src
  gcc -DHCG `pkg-config gtk+-2.0 gthread-2.0 --cflags` -DHCG_E -c main.c || return 1
  gcc -DHCG `pkg-config gtk+-2.0 gthread-2.0 --cflags` -DHCG_E -c utils.c || return 1
  gcc -DHCG_E -c hc_functions.c || return 1
  gcc -DHCG_E -c hc.c || return 1
  gcc `pkg-config gtk+-2.0 gthread-2.0 --cflags --libs` main.o utils.o hc_functions.o hc.o /usr/lib/libmapm.so.0 -o hcg || return 1
  mkdir -p $startdir/pkg/usr/bin
  mkdir -p $startdir/pkg/usr/share/$pkgname
  cp $startdir/src/$pkgname-$pkgver-src/$pkgname $startdir/pkg/usr/bin
  cp -a $startdir/src/$pkgname-$pkgver-src/README $startdir/pkg/usr/share/$pkgname
  cp -a $startdir/src/$pkgname-$pkgver-src/LICENSE $startdir/pkg/usr/share/$pkgname
}
# Contributor: Jan Dlabal <dlabaljan at gmail dot com>
pkgname=hc
pkgver=0.4.2
pkgrel=1
pkgdesc="HoubySoft Calculator - a calculator with lot of options and abundant functions - CLI version"
url="http://hc.houbysoft.com"
depends=('mapm')
provides=('hc')
source=("http://houbysoft.com/download/$pkgname-$pkgver-src.tar.gz")
md5sums=('2256ea75ecee8bd41a3d1d02bb189945')
license=('GPL 3')
arch=('i686' 'x86_64')

build() {
  cd  $startdir/src/$pkgname-$pkgver-src
  gcc -c main.c || return 1
  gcc -c hc.c || return 1
  gcc -c hc_functions.c || return 1
  gcc main.o hc_functions.o hc.o /usr/lib/libmapm.so.0 -lm -o hc || return 1
  mkdir -p $startdir/pkg/usr/bin
  mkdir -p $startdir/pkg/usr/share/$pkgname
  cp $startdir/src/$pkgname-$pkgver-src/$pkgname $startdir/pkg/usr/bin
  cp -a $startdir/src/$pkgname-$pkgver-src/README $startdir/pkg/usr/share/$pkgname
  cp -a $startdir/src/$pkgname-$pkgver-src/LICENSE $startdir/pkg/usr/share/$pkgname
}

So I am just submitting these for review and testing, and further advice as to what to do now, ie is it ready to be uploaded to AUR? Is there anything else that needs to be done? Anything that should be changed in the PKGBUILDs?

Thanks

Offline

#2 2009-11-28 17:17:58

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: hc, hcg, and libmapm PKGBUILDs advice/testing

There are a few issues with the posted PKGBUILDs:

- Packages that are in the `base-devel' group shouldn't be listed as dependencies (either runtime or build).
- If the license is not included in the `licenses' package (which installs common open source licenses under /usr/share/licenses/common), the license name must be prefixed with `custom:' and a copy of the supplied license installed under /usr/share/licenses/$pkgname (where $pkgname is the name of the package). The `custom:' prefix doesn't apply to BSD and MIT licenses, but you still need to install a copy of the license. Also note that there are no spaces in the names of the common licenses, so you need to change `GPL 3' to `GPL3'.
- The `provides' array shouldn't include the package name. It's usually used to help resolve other packages' dependencies after a name change.
- It might be a good idea to use any provided Makefiles instead of building the application manually.
- Use of $startdir is discouraged. Use $srcdir and $pkgdir instead of $startdir/src and $startdir/pkg respectively.
- It would be nice to order the fields as shown in /usr/share/pacman/PKGBUILD.proto.

Lastly, have a read at the following wiki pages (if you haven't already):

http://wiki.archlinux.org/index.php/AUR_User_Guidelines
http://wiki.archlinux.org/index.php/Arc … _Standards

Cheers. smile

Offline

#3 2009-11-28 21:05:07

y27
Member
Registered: 2009-05-27
Posts: 147
Website

Re: hc, hcg, and libmapm PKGBUILDs advice/testing

Thanks for your advice. I fixed everything (hopefully) except the Makefile, because all the packages were originally built statically, and so I think it's simpler to just do this.

Modified PKGBUILD for mapm:

# Contributor: Fabio Comolli <fabio.comolli@gmail.com>
pkgname=mapm
pkgver=4.9.5
pkgrel=1
pkgdesc="Mike's Arbitrary Precision Math Library"
arch=('i686' 'x86_64')
url="http://www.tc.umn.edu/~ringx004/mapm-main.html"
license=('custom')
source=("http://www.tc.umn.edu/~ringx004/mapm-$pkgver.tar.gz")
md5sums=('a92ff86b6240f78f882661e0b1c11920')

build() {
  cd $srcdir/mapm_$pkgver
  gcc -c -Wall -O2 -fPIC map*.c || return 1
  gcc -shared -o libmapm.so.0 map*.o || return 1
  mkdir -p $pkgdir/usr/lib
  mkdir -p $pkgdir/usr/include
  mkdir -p $pkgdir/usr/share/mapm
  cp $srcdir/mapm_$pkgver/libmapm.so.0 $pkgdir/usr/lib
  cp $srcdir/mapm_$pkgver/m_apm*.h $pkgdir/usr/include
  cp -a $srcdir/mapm_$pkgver/DOCS $pkgdir/usr/share/mapm
  install -D -m644 ../../mapm_license.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE || return 1
}

mapm_license.txt to be included (the source package does not contain any file specially for the license, so it's probably simpler to cut it from the README and put it in a new file?):

**************************************************************************
  
                   MAPM

                   Version 4.9.5

                 December 10, 2007

                  Michael C. Ring

                ringx004@tc.umn.edu

            Latest release will be available at
                http://tc.umn.edu/~ringx004

***************************************************************************
*                                      *
*  Copyright (C) 1999 - 2007   Michael C. Ring                            *
*                                      *
*  This software is Freeware.                          *
*                                      *
*  Permission to use, copy, and distribute this software and its          *
*  documentation for any purpose with or without fee is hereby granted,   *
*  provided that the above copyright notice appear in all copies and      *
*  that both that copyright notice and this permission notice appear      *
*  in supporting documentation.                                           *
*                                      *
*  Permission to modify the software is granted. Permission to distribute *
*  the modified code is granted. Modifications are to be distributed by   *
*  using the file 'license.txt' as a template to modify the file header.  *
*  'license.txt' is available in the official MAPM distribution.          *
*                                      *
*  To distribute modified source code, insert the file 'license.txt'      *
*  at the top of all modified source code files and edit accordingly.     *
*                                      *
*  This software is provided "as is" without express or implied warranty. *
*                                      *
***************************************************************************

Modified hcg PKGBUILD:

# Contributor: Fabio Comolli <fabio.comolli@gmail.com>
pkgname=hcg
pkgver=0.4.2
pkgrel=1
pkgdesc="HoubySoft Calculator - a calculator with lot of options and abundant functions"
arch=('i686' 'x86_64')
url="http://hc.houbysoft.com"
license=('GPL3')
depends=('mapm' 'gtk2' 'glib2')
source=("http://houbysoft.com/download/$pkgname-$pkgver-src.tar.gz")
md5sums=('3c06c0d9e4ffb220a30820c733d55d1d')

build() {
  cd  $srcdir/$pkgname-$pkgver-src
  gcc -DHCG `pkg-config gtk+-2.0 gthread-2.0 --cflags` -DHCG_E -c main.c || return 1
  gcc -DHCG `pkg-config gtk+-2.0 gthread-2.0 --cflags` -DHCG_E -c utils.c || return 1
  gcc -DHCG_E -c hc_functions.c || return 1
  gcc -DHCG_E -c hc.c || return 1
  gcc `pkg-config gtk+-2.0 gthread-2.0 --cflags --libs` main.o utils.o hc_functions.o hc.o /usr/lib/libmapm.so.0 -o hcg || return 1
  mkdir -p $pkgdir/usr/bin
  mkdir -p $pkgdir/usr/share/$pkgname
  cp $srcdir/$pkgname-$pkgver-src/$pkgname $pkgdir/usr/bin
  cp -a $srcdir/$pkgname-$pkgver-src/README $pkgdir/usr/share/$pkgname
  cp -a $srcdir/$pkgname-$pkgver-src/LICENSE $pkgdir/usr/share/$pkgname
}

Modified hc PKGBUILD:

# Contributor: Jan Dlabal <dlabaljan at gmail dot com>
pkgname=hc
pkgver=0.4.2
pkgrel=1
pkgdesc="HoubySoft Calculator - a calculator with lot of options and abundant functions - CLI version"
arch=('i686' 'x86_64')
url="http://hc.houbysoft.com"
license=('GPL3')
depends=('mapm')
source=("http://houbysoft.com/download/$pkgname-$pkgver-src.tar.gz")
md5sums=('2256ea75ecee8bd41a3d1d02bb189945')

build() {
  cd  $srcdir/$pkgname-$pkgver-src
  gcc -c main.c || return 1
  gcc -c hc.c || return 1
  gcc -c hc_functions.c || return 1
  gcc main.o hc_functions.o hc.o /usr/lib/libmapm.so.0 -lm -o hc || return 1
  mkdir -p $pkgdir/usr/bin
  mkdir -p $pkgdir/usr/share/$pkgname
  cp $srcdir/$pkgname-$pkgver-src/$pkgname $pkgdir/usr/bin
  cp -a $srcdir/$pkgname-$pkgver-src/README $pkgdir/usr/share/$pkgname
  cp -a $srcdir/$pkgname-$pkgver-src/LICENSE $pkgdir/usr/share/$pkgname
}

Do you think it's ready for upload now?
Regards,
Jan

Offline

#4 2009-11-28 22:40:51

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: hc, hcg, and libmapm PKGBUILDs advice/testing

If you decide to include the license information for mapm in a separate file (which is fine), make sure you add it to the source array and then copy it from the $srcdir directory (PKGBUILDs shouldn't reference files outside of $srcdir). The other two packages do not need to include any license files, as GPL3 is specified and its full text can be found in /usr/share/licenses/common/GPL3/license.txt.

Generally, it's discouraged to repeat the name of the application in the package description. In your case, pkgname isn't very telling, so I'll leave it up to you to decide whether it's better to remove the name from the description or leave it as is.

Another completely cosmetic change you might want to consider is removing the `$srcdir/$pkgname-$pkgver-src' part from the `cp' commands at the end of the PKGBUILDs for hcg and hc, since you're already inside that directory. That, and possibly substituting the mkdir/cp commands with `install'. For example, this:

  mkdir -p $pkgdir/usr/bin
  mkdir -p $pkgdir/usr/share/$pkgname
  cp $srcdir/$pkgname-$pkgver-src/$pkgname $pkgdir/usr/bin
  cp -a $srcdir/$pkgname-$pkgver-src/README $pkgdir/usr/share/$pkgname

would become:

  install -D $pkgname "$pkgdir/usr/bin/$pkgname"
  install -D -m644 README "$pkgdir/usr/share/$pkgname/README"

Finally, it would be a good idea to run `namcap' on the PKGBUILDs and the produced packages in case you've missed something (dependencies, installation paths, and many more little things).

(I'll give hc a try when you upload it to the AUR. CLI calculator sounds nice. tongue )

Offline

#5 2009-11-29 02:30:36

y27
Member
Registered: 2009-05-27
Posts: 147
Website

Re: hc, hcg, and libmapm PKGBUILDs advice/testing

OK thanks a lot for your help.

I left the names as is since as you said it explains the name a little. I fixed the installs, and I also fixed a few things namcap told me, for example I included glibc as a dependency and I removed glib2 since it's already included by gtk2.

Also, I added myself as a maintainer everywhere since it was complaining, and left goran'agar as a Contributor, I hope this is the way it should be done.

Then I ran namcap on the results, everything was fine, except it said that 'mapm' is not needed for hc and hcg, which is wrong so I left it as is.

The resulting packages receive no warnings/errors from namcap except the above, so I uploaded them:

mapm : http://aur.archlinux.org/packages.php?ID=32319
hc : http://aur.archlinux.org/packages.php?ID=32321
hcg : http://aur.archlinux.org/packages.php?ID=32320

Thanks a lot for your valuable help!

P.S.
I also changed the version and the md5's, since I fixed a bug in the previous version.

Offline

#6 2009-11-30 11:23:01

Andrwe
Member
From: Leipzig/Germany
Registered: 2009-06-17
Posts: 322
Website

Re: hc, hcg, and libmapm PKGBUILDs advice/testing

hc cause many system crashes for me.
You should catch all, you can't work with.
e.g: I've type accidentally =3*5 and I just had 3 seconds till full crash.
Also I don't understand why I can't type 3*5 I always get syntax error.

Offline

#7 2009-11-30 14:28:11

y27
Member
Registered: 2009-05-27
Posts: 147
Website

Re: hc, hcg, and libmapm PKGBUILDs advice/testing

Andrwe, that's strange, I just tried, it does it correctly on my computer. If I type 3*5 it gives 15 , =3*5 gives syntax error.

Can you give some more details? Also are you sure you installed mapm correctly?

Offline

#8 2009-11-30 14:50:29

Andrwe
Member
From: Leipzig/Germany
Registered: 2009-06-17
Posts: 322
Website

Re: hc, hcg, and libmapm PKGBUILDs advice/testing

mapm is installed:

pacman -Qi mapm
Name                 : mapm
Version              : 4.9.5-1
URL                  : http://www.tc.umn.edu/~ringx004/mapm-main.html
Lizenzen             : custom  
Gruppen              : Nichts
Stellt bereit        : Nichts
Hängt ab von         : glibc  
Optionale Abhängigkeiten: Nichts
Benötigt von         : hcg  
Konflikt mit         : Nichts
Ersetzt              : Nichts
Installationsgröße   : 336,00 K
Packer               : Unknown Packager
Architektur          : x86_64
Erstellt am          : So 29 Nov 2009 11:47:59 CET
Installiert am       : So 29 Nov 2009 11:48:05 CET
Installationsgrund   : Ausdrücklich installiert
Installations-Skript : Nein
Beschreibung         : Mike's Arbitrary Precision Math Library

I updated hcg today but it doesn't solved anything.
OS: x86_64 arch
LANG: de
Keylayout: de_DE.UTF-8

Which details do you want to know?

Offline

#9 2009-11-30 15:17:46

y27
Member
Registered: 2009-05-27
Posts: 147
Website

Re: hc, hcg, and libmapm PKGBUILDs advice/testing

OK, you gave the detail I wanted, which is that you are running a x86_64 version. I don't have any systems running ArchLinux on 64-bit; however, I have a machine with Ubuntu 64-bit, and I tried compiling both the lib and hc there (from their sources though, not the PKGBUILDs, and it was linked statically), and it worked, so I assumed that the PKGBUILDs should work on 64bit also.

Also, on that machine, the precompiled package (http://houbysoft.com/download/hc-0.4.2.1-linux.tar.gz) worked fine, maybe you could try that?

If that doesn't work as well, I would recommend to try to remove everything you installed with the AUR packages (I mean pacman -R hc hcg mapm), and then try to compile them from their sources (MAPM can be downloaded from http://www.tc.umn.edu/~ringx004/mapm-main.html , hc from http://houbysoft.com/download/hc-0.4.2.1-src.tar.gz). This will compile both statically, and I can confirm it works on the ubuntu 64bit.

Offline

#10 2009-11-30 16:03:37

Andrwe
Member
From: Leipzig/Germany
Registered: 2009-06-17
Posts: 322
Website

Re: hc, hcg, and libmapm PKGBUILDs advice/testing

The PKGBUILD already uses the sources and compiles them.

Offline

#11 2009-11-30 16:59:46

y27
Member
Registered: 2009-05-27
Posts: 147
Website

Re: hc, hcg, and libmapm PKGBUILDs advice/testing

Of course, but the PKGBUILDs compile them dynamically; if you compile them from source and using the Makefile in the source package, they will be compiled statically. That's what I was advising you to try in my last post...

Because compiling statically on x64 worked for me.

Offline

Board footer

Powered by FluxBB