Thanks Jesse :) I've already installed it on my PC and it works, so I've started making the PKGBUILD with your help and the steps I did. I've wrote all the information, and by now that's what I have:
# Maintainer: Jorge jorge.barroso.11@gmail.com
pkgname=linux-manga-downloader pkgver=0.2.0.1-5 pkgrel=1 pkgdesc="A manga downloader for linux, it allows fownloads from many English and Spanish websites" arch=('any') url="http://code.google.com/p/linux-manga-downloader/" license=('GPL3') depends=('libnotify' 'gtkdialog' 'wget' 'lynx' 'zenity') install= source=($pkgname-$pkgver.tar.gz)
--Well, about the build, I'm not sure (0% sure) but I think it could be something like that:
cd "$srcdir/$pkgname_$pkgver/usr/local/bin" chmod +x 4chan chmod +x animea chmod +x danboru chmod +x futahentai chmod +x ge-2 chmod +x lmd chmod +x lmd-fu chmod +x mangafox chmod +x mangareader chmod +x mangashare chmod +x mcanime chmod +x pown chmod +x submanga chmod +x zerochan
cp 4chan /usr/local/bin/4chan cp animea /usr/local/bin/animea cp danboru /usr/local/bin/danboru cp futahentai /usr/local/bin/futahentai cp ge-2 /usr/local/bin/ge-2 cp lmd /usr/local/bin/lmd cp lmd-fu /usr/local/bin/lmd-fu cp mangafox /usr/local/bin/mangafox cp mangareader /usr/local/bin/mangareader cp mangashare /usr/local/bin/mangashare cp mcanime /usr/local/bin/mcanime cp pown /usr/local/bin/pown cp submanga /usr/local/bin/submanga cp zerochan /usr/local/bin/zerochan
and well... the same with the /usr/share directories. I've although thought writing that on an install script, but then I don't know what to write on "build"
I think that I shouldn't write directly /usr/local/bin, but I don't know the "$variable" name of the directories...
Thanks again jesse, and hope someone helps me to finish with that first package ;)
Hello,
first of all, is should be something like "cp zerochan $pkgdir/usr/local/bin/zerochan". Otherwise the build will fail. Second, I think install is better than cp in this occasion, since you can set the permission bits while copying. For example install -m755 zerochan $pkgdir/usr/local/bin/zerochan
Also, all the copying should probably go in the package() function and not in build().
If you want, take a look at this[1] very simple PKGBUILD of mine.
Just a few friendly pointers, Chris Sakalis
[1] https://aur.archlinux.org/packages/gi/gimp-plugin-wavelet-sharpen/PKGBUILD
On Tue, May 8, 2012 at 7:16 PM, Jorge Barroso jorge.barroso.11@gmail.com wrote:
Thanks Jesse :) I've already installed it on my PC and it works, so I've started making the PKGBUILD with your help and the steps I did. I've wrote all the information, and by now that's what I have:
# Maintainer: Jorge jorge.barroso.11@gmail.com
pkgname=linux-manga-downloader pkgver=0.2.0.1-5 pkgrel=1 pkgdesc="A manga downloader for linux, it allows fownloads from many English and Spanish websites" arch=('any') url="http://code.google.com/p/linux-manga-downloader/" license=('GPL3') depends=('libnotify' 'gtkdialog' 'wget' 'lynx' 'zenity') install= source=($pkgname-$pkgver.tar.gz)
--Well, about the build, I'm not sure (0% sure) but I think it could be something like that:
cd "$srcdir/$pkgname_$pkgver/usr/local/bin" chmod +x 4chan chmod +x animea chmod +x danboru chmod +x futahentai chmod +x ge-2 chmod +x lmd chmod +x lmd-fu chmod +x mangafox chmod +x mangareader chmod +x mangashare chmod +x mcanime chmod +x pown chmod +x submanga chmod +x zerochan
cp 4chan /usr/local/bin/4chan cp animea /usr/local/bin/animea cp danboru /usr/local/bin/danboru cp futahentai /usr/local/bin/futahentai cp ge-2 /usr/local/bin/ge-2 cp lmd /usr/local/bin/lmd cp lmd-fu /usr/local/bin/lmd-fu cp mangafox /usr/local/bin/mangafox cp mangareader /usr/local/bin/mangareader cp mangashare /usr/local/bin/mangashare cp mcanime /usr/local/bin/mcanime cp pown /usr/local/bin/pown cp submanga /usr/local/bin/submanga cp zerochan /usr/local/bin/zerochan
and well... the same with the /usr/share directories. I've although thought writing that on an install script, but then I don't know what to write on "build"
I think that I shouldn't write directly /usr/local/bin, but I don't know the "$variable" name of the directories...
Thanks again jesse, and hope someone helps me to finish with that first package ;)
ti, 2012-05-08 kello 18:16 +0200, Jorge Barroso kirjoitti:
pkgver=0.2.0.1-5
If I'm not completely mistaken '-' is not allowed in the version string. set the version to 0.2.0.1_5Beta. And then add another variable. _rawversion=0.2.0.1-5
pkgdesc="A manga downloader for linux, it allows fownloads from many English and Spanish websites"
the description could be shortened to this "Download manga from several English and Spanish websites." The description should be as short as possible, but still of course try to distinct it from other same kind of apps.
arch=('any') url="http://code.google.com/p/linux-manga-downloader/" license=('GPL3') depends=('libnotify' 'gtkdialog' 'wget' 'lynx' 'zenity')
You can just omit the install variable, you don't need instal file for this package so no need for the install= variable ether.
source=($pkgname-$pkgver.tar.gz)
This is plain wrong. This tells makepkg to include the source-files of the application in the ArchLinux PKGBUILD source-package. This is wrong. Instead you should provide full URL to the download file online. So it should be source=(http://$%7Bpkgabme%7D.googlecode.com/files/$%7Bpkgname%7D_ ${_rawversion}_all.deb)
build() function is met only for the command needed to compile the sourcecode into binary executable. Usually this includes commands ./configure --prefix=/usr and make for c and c++ aplications.
package() funcktion in the other hand is used to copy the files into their rightfull place, if the application comes with Makefile you use command 'make DESTDIR="${pkgdir}" install' for this
cd "$srcdir/$pkgname_$pkgver/usr/local/bin" chmod +x 4chan
......
cp zerochan /usr/local/bin/zerochan
All that could be simplified into --------------------------------------- 1. cd "${srcdir}" 2. tar xf data.tar.gz 3. mkdir -p "${pkgdir}/usr/" 4. cp -r "${srcdir}/./usr/local/bin" "${pkgdir}/usr/bin" 5. cp -r "${srcdir}/./usr/share" "${pkgdir}/usr/share" 6. 7. chmod +x "${pkgdir}/usr/bin"/* 8. sed 's|usr/local|usr|' -i "${pkgdir}/usr/bin"/* 9. sed 's|usr/local|usr|' -i "${pkgdir}/usr/share/applications/LDM.desktop" --------------------------------------- Explanation: 1. cd into the directory where our extracted deb file is 2. extrackt the data file part of the deb archive 3. Make the directory /usr in directory ${pkgdir} ${pkgdir}== /the/directory/where/your/PKGBUILD_file_is/pkg 4. copy the bin directory to ${pkgdir}/usr/bin, this is important part. You MUST never copy anyfiles to /usr or anytoher direcoty, without putting ${pkgdir} in front of it. Othervice makepkg will try to copy that file directly to the system, instead of putting it in a pacman installable file. The -r after cp tell cp to copy the whole directory 5. Do the same for the share directory. Also notice that in line 4 we copy the file to /usr/bin and not /usr/local/bin. This is becouse we don't use the /usr/local directory in ArchLinux and so everythin should go to /usr. 6. Just some randon empty line to make reading easyer. One between lines 1 and 2 would be nice too. Does not serve any bigger purpose. 7. Make sure every file in directory "${pkgdir}/usr/bin" is executable. 8. Make sure that we don't refer to the old ubuntu stule /usr/local/ directory anywhere, but instead use the Arch style /usr only. 9. Fix the desktop file to point into /usr instead of /usr/local
I think this should make everything clear :D (You still have to fix any errors I might have made) Also like Chris Shakalis said you could use the install command instead of cp and chmod, but cp and chmod work as well too.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2012-05-08 14:42, Jesse Juhani Jaara wrote:
ti, 2012-05-08 kello 18:16 +0200, Jorge Barroso kirjoitti: <snip> All that could be simplified into --------------------------------------- 1. cd "${srcdir}" 2. tar xf data.tar.gz 3. mkdir -p "${pkgdir}/usr/" 4. cp -r "${srcdir}/./usr/local/bin" "${pkgdir}/usr/bin" 5. cp -r "${srcdir}/./usr/share" "${pkgdir}/usr/share" 6. 7. chmod +x "${pkgdir}/usr/bin"/* 8. sed 's|usr/local|usr|' -i "${pkgdir}/usr/bin"/* 9. sed 's|usr/local|usr|' -i "${pkgdir}/usr/share/applications/LDM.desktop" --------------------------------------- <snip>
Instead of mkdir, cp and chmod, use "install -D -m 755 path/to/source path/to/destination" "-D" creates the directory. "-m" set the file mode (like chmod) See man install for more info.
- -- Hugo Osvaldo Barrera
2012/6/6 Hugo Osvaldo Barrera hugo@osvaldobarrera.com.ar
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2012-05-08 14:42, Jesse Juhani Jaara wrote:
ti, 2012-05-08 kello 18:16 +0200, Jorge Barroso kirjoitti: <snip> All that could be simplified into --------------------------------------- 1. cd "${srcdir}" 2. tar xf data.tar.gz 3. mkdir -p "${pkgdir}/usr/" 4. cp -r "${srcdir}/./usr/local/bin" "${pkgdir}/usr/bin" 5. cp -r "${srcdir}/./usr/share" "${pkgdir}/usr/share" 6. 7. chmod +x "${pkgdir}/usr/bin"/* 8. sed 's|usr/local|usr|' -i "${pkgdir}/usr/bin"/* 9. sed 's|usr/local|usr|' -i "${pkgdir}/usr/share/applications/LDM.desktop" --------------------------------------- <snip>
Instead of mkdir, cp and chmod, use "install -D -m 755 path/to/source path/to/destination" "-D" creates the directory. "-m" set the file mode (like chmod) See man install for more info.
mmm ok, I'll try with install :D mmm just a question: how could I change the owner (I wnat to say, with that PKGBUILD it installs but the owner of archives is root, so it has no icon and an script to avoid making lmd --reconf doesn't works because it is an extra code that only works running lmd like root, and it conflicts because lmd can't be ran like root, so, in short, what I want it's a bash code to change the owner user of lmd when installing)
2012/6/6 Jorge Barroso jorge.barroso.11@gmail.com:
2012/6/6 Hugo Osvaldo Barrera hugo@osvaldobarrera.com.ar
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2012-05-08 14:42, Jesse Juhani Jaara wrote:
ti, 2012-05-08 kello 18:16 +0200, Jorge Barroso kirjoitti: <snip> All that could be simplified into --------------------------------------- 1. cd "${srcdir}" 2. tar xf data.tar.gz 3. mkdir -p "${pkgdir}/usr/" 4. cp -r "${srcdir}/./usr/local/bin" "${pkgdir}/usr/bin" 5. cp -r "${srcdir}/./usr/share" "${pkgdir}/usr/share" 6. 7. chmod +x "${pkgdir}/usr/bin"/* 8. sed 's|usr/local|usr|' -i "${pkgdir}/usr/bin"/* 9. sed 's|usr/local|usr|' -i "${pkgdir}/usr/share/applications/LDM.desktop" --------------------------------------- <snip>
Instead of mkdir, cp and chmod, use "install -D -m 755 path/to/source path/to/destination" "-D" creates the directory. "-m" set the file mode (like chmod) See man install for more info.
mmm ok, I'll try with install :D mmm just a question: how could I change the owner (I wnat to say, with that PKGBUILD it installs but the owner of archives is root, so it has no icon and an script to avoid making lmd --reconf doesn't works because it is an extra code that only works running lmd like root, and it conflicts because lmd can't be ran like root, so, in short, what I want it's a bash code to change the owner user of lmd when installing)
option: '-o' or '--owner=OWNER'
See this and more in the man page
2012/6/6 rafael ff1 rafael.f.f1@gmail.com
option: '-o' or '--owner=OWNER'
See this and more in the man page
Ok, thanks, but the problem is that I can't set an specific username, because it has to be the installer username and trying with $USER it equally sets root as user... I think (y tried with chown in a patch as well and this was the result)
2012/6/6 Jorge Barroso jorge.barroso.11@gmail.com:
2012/6/6 rafael ff1 rafael.f.f1@gmail.com
option: '-o' or '--owner=OWNER'
See this and more in the man page
Ok, thanks, but the problem is that I can't set an specific username, because it has to be the installer username and trying with $USER it equally sets root as user... I think (y tried with chown in a patch as well and this was the result)
Please send source tarball (or PKGBUILD, if it is the only file) that has the problem mentioned before (about image, etc.).
Rafael
2012/6/6 rafael ff1 rafael.f.f1@gmail.com
2012/6/6 Jorge Barroso jorge.barroso.11@gmail.com:
2012/6/6 rafael ff1 rafael.f.f1@gmail.com
option: '-o' or '--owner=OWNER'
See this and more in the man page
Ok, thanks, but the problem is that I can't set an specific username, because it has to be the installer username and trying with $USER it equally sets root as user... I think (y tried with chown in a patch as
well
and this was the result)
Please send source tarball (or PKGBUILD, if it is the only file) that has the problem mentioned before (about image, etc.).
https://aur.archlinux.org/packages.php?ID=59118 this is the package, you can download or see online the PKGBUILD there. I tried to use chown in this package, and it sets $USER as root :S
2012/6/6 Jorge Barroso jorge.barroso.11@gmail.com:
2012/6/6 rafael ff1 rafael.f.f1@gmail.com
2012/6/6 Jorge Barroso jorge.barroso.11@gmail.com:
2012/6/6 rafael ff1 rafael.f.f1@gmail.com
option: '-o' or '--owner=OWNER'
See this and more in the man page
Ok, thanks, but the problem is that I can't set an specific username, because it has to be the installer username and trying with $USER it equally sets root as user... I think (y tried with chown in a patch as
well
and this was the result)
Please send source tarball (or PKGBUILD, if it is the only file) that has the problem mentioned before (about image, etc.).
https://aur.archlinux.org/packages.php?ID=59118 this is the package, you can download or see online the PKGBUILD there. I tried to use chown in this package, and it sets $USER as root :S
I was debugging your PKGBUILD and how the behavior of LDM, and I was not able to find any problem related to user permissions. Maybe you can enlighten me.
Only problem I figure out is that when the ~/.LMD do not exists, running /usr/bin/lmd will report errors messages because it did not find ~/LMD/options... That is upstream's fault, as it should be able to figure out that ~/.LMD/options doesn't exist before trying to source it... Is this the problem you are having script related?
Rafael
2012/6/7 rafael ff1 rafael.f.f1@gmail.com
I was debugging your PKGBUILD and how the behavior of LDM, and I was not able to find any problem related to user permissions. Maybe you can enlighten me.
Only problem I figure out is that when the ~/.LMD do not exists, running /usr/bin/lmd will report errors messages because it did not find ~/LMD/options... That is upstream's fault, as it should be able to figure out that ~/.LMD/options doesn't exist before trying to source it... Is this the problem you are having script related
Yes, that's the problem I have, the source is made by a student, so it's not complete, and I added a piece of source that checks if .LMD exists and if it doesn't exists it is created, without having to make anything (sed -s '325s#then#then\n\t[ ! -d ~/.LMD ] && lmd -reconf#' -i "${pkgdir}"/usr/bin/lmd) But as the program owner after the installation is by default root, it doesn't works... moreover, the program can't be run as root, so I tried to change the user, with chown, and after that, as it doesn't worked, tried with another script on the post_install
*if { [ ! -d /home/$USER /.LMD ] then lmd -reconf else echo "*\033[1;32m* .LMD already exists* \033[0m*"*
The problem is that $USER is root, so it works, but only on the /root folder, and it should do that on the local user folder
So, the problem is... $USER shouldn't be 'root', but the local user (in my case, for example, jorge). If I can do that I think the both two scripts will work... but I don't know how...
2012/6/7 Jorge Barroso jorge.barroso.11@gmail.com:
2012/6/7 rafael ff1 rafael.f.f1@gmail.com
I was debugging your PKGBUILD and how the behavior of LDM, and I was not able to find any problem related to user permissions. Maybe you can enlighten me.
Only problem I figure out is that when the ~/.LMD do not exists, running /usr/bin/lmd will report errors messages because it did not find ~/LMD/options... That is upstream's fault, as it should be able to figure out that ~/.LMD/options doesn't exist before trying to source it... Is this the problem you are having script related
Yes, that's the problem I have, the source is made by a student, so it's not complete, and I added a piece of source that checks if .LMD exists and if it doesn't exists it is created, without having to make anything (sed -s '325s#then#then\n\t[ ! -d ~/.LMD ] && lmd -reconf#' -i "${pkgdir}"/usr/bin/lmd)
yeah, I gave you this idea. ;) It has some problems, as LMD tried to source ~/.LMD/options (in line 5) before this piece of source. Also, why call "lmd -reconf" instead "lmd -reconf"? - not one of my brightest idea.
But as the program owner after the installation is by default root, it doesn't works... moreover, the program can't be run as root, so I tried to change the user, with chown, and after that, as it doesn't worked, tried with another script on the post_install
*if { [ ! -d /home/$USER /.LMD ] then lmd -reconf else echo "*\033[1;32m* .LMD already exists* \033[0m*"*
The problem is that $USER is root, so it works, but only on the /root folder, and it should do that on the local user folder
So, the problem is... $USER shouldn't be 'root', but the local user (in my case, for example, jorge). If I can do that I think the both two scripts will work... but I don't know how...
You did not understand. If we are talking about same issue, the problem is not a user permission related.
See below the output I get when ~/.LMD doesn't exist and I run /usr/bin/lmd, installed with your package. This will happen only once, as in the second time ~/.LMD was already created:
$ lmd /usr/bin/lmd: line 5: /home/rafael/.LMD/options: No such file or directory /usr/bin/lmd: line 6: source: /usr/share/lmd/langs/: is a directory /usr/bin/lmd: line 5: /home/rafael/.LMD/options: No such file or directory /usr/bin/lmd: line 6: source: /usr/share/lmd/langs/: is a directory -reconf completed
** (gtkdialog:12958): ERROR **: gtkdialog: Error in line 23, near token '</label>': syntax error
/usr/bin/lmd: line 346: 12958 Trace/breakpoint trap gtkdialog --program=MAIN_DIALOG
Solution to this issue is: replace 'sed' code you mentioned above with the patch I sent to the upstream [1] along with this line: patch -p1 "${pkgdir}"/usr/bin/lmd lmd-run-reconf.patch
[1] http://code.google.com/p/linux-manga-downloader/issues/detail?id=4
Rafael
2012/6/7 rafael ff1 rafael.f.f1@gmail.com
yeah, I gave you this idea. ;) It has some problems, as LMD tried to source ~/.LMD/options (in line 5) before this piece of source. Also, why call "lmd -reconf" instead "lmd -reconf"? - not one of my brightest idea.
* Jajaja, don't worry, it's a better idea than the ones I had XD *
You did not understand. If we are talking about same issue, the problem is not a user permission related.
See below the output I get when ~/.LMD doesn't exist and I run /usr/bin/lmd, installed with your package. This will happen only once, as in the second time ~/.LMD was already created:
$ lmd /usr/bin/lmd: line 5: /home/rafael/.LMD/options: No such file or directory /usr/bin/lmd: line 6: source: /usr/share/lmd/langs/: is a directory /usr/bin/lmd: line 5: /home/rafael/.LMD/options: No such file or directory /usr/bin/lmd: line 6: source: /usr/share/lmd/langs/: is a directory -reconf completed
** (gtkdialog:12958): ERROR **: gtkdialog: Error in line 23, near token '</label>': syntax error
/usr/bin/lmd: line 346: 12958 Trace/breakpoint trap gtkdialog --program=MAIN_DIALOG
Solution to this issue is: replace 'sed' code you mentioned above with the patch I sent to the upstream [1] along with this line: patch -p1 "${pkgdir}"/usr/bin/lmd lmd-run-reconf.patch
[1] http://code.google.com/p/linux-manga-downloader/issues/detail?id=4
Oh ok XD yes I wasn't understood you at all... but yes now I know what do you want to say... thanks for the patch, I'll add the patch to de PKBUILD and hope it works :D sure! cheers!
aur-general@lists.archlinux.org