Re: [aur-general] Fwd: :Re Linux Manga Downloader
Thanks to both you two Jesse and Chris, I won't copy the both replies here to make the message shorter. I did at first what Chris told me about the install option, I liked it, but, at least BY NOW, I'll use the chmod/copy combination, because I'm not new, but I know less things than that I thought, and I would like to learn little by little. Respect to Jesse's message, I did it with your help, correcting some little details and I think now it's correct :D I would like a little introduccion to "sed" option, because I didn't know it, not a lot, but, as "cp" copies a directory on another one, what makes "sed"? :) Thanks for your help, and this is my PKGBUILD by now, hope it's correct ;) # Maintainer: Your Name <youremail@domain.com> pkgname=linux-manga-downloader pkgver=0.2.0.1-5Beta _rawversion=0.2.0.1 pkgrel=1 pkgdesc="A manga downloader for many English and Spanish websites" arch=('any') url="http://code.google.com/p/${pkgname}/" license=('GPL3') depends=('libnotify' 'gtkdialog' 'wget' 'lynx' 'zenity') source= http://code.google.com/${pkgname}/downloads/detail?name=${pkgname}_${pkgver}_all.deb ) package() { cd "${srcdir}" tar -xfzv data.tar.gz mkdir -p "${pkgdir}/usr/" cp -r "${srcdir}/./usr/local/bin" "${pkgdir}/usr/bin" cp -r "${srcdir}/./usr/share" "${pkgdir}/usr/share" chmod +x "${pkgdir}/usr/bin"/* sed 's|usr/local|usr|' -i "${pkgdir}/usr/bin"/* sed 's|usr/local|usr|' -i "${pkgdir}/usr/share/applications/LDM.desktop" } echo "Now, been in your HOME directory, run: lmd -reconf and then run the program ;) enjoy it." echo "In some Websites, when downloading, the program says there was an error with the last page of the chapter, don't worry, coding mistake, that page was downloaded successfully" # vim:set ts=2 sw=2 et: The two "echo" at the end are to add two comments that I considered important things to know :) So... what do you thing about the PKGBUILD now? :)
On Tue, May 8, 2012 at 10:03 PM, Jorge Barroso <jorge.barroso.11@gmail.com> wrote:
Thanks to both you two Jesse and Chris, I won't copy the both replies here to make the message shorter. I did at first what Chris told me about the install option, I liked it, but, at least BY NOW, I'll use the chmod/copy combination, because I'm not new, but I know less things than that I thought, and I would like to learn little by little. Respect to Jesse's message, I did it with your help, correcting some little details and I think now it's correct :D I would like a little introduccion to "sed" option, because I didn't know it, not a lot, but, as "cp" copies a directory on another one, what makes "sed"? :) Thanks for your help, and this is my PKGBUILD by now, hope it's correct ;)
# Maintainer: Your Name <youremail@domain.com> pkgname=linux-manga-downloader pkgver=0.2.0.1-5Beta _rawversion=0.2.0.1 pkgrel=1 pkgdesc="A manga downloader for many English and Spanish websites" arch=('any') url="http://code.google.com/p/${pkgname}/" license=('GPL3') depends=('libnotify' 'gtkdialog' 'wget' 'lynx' 'zenity') source= http://code.google.com/${pkgname}/downloads/detail?name=${pkgname}_${pkgver}_all.deb )
package() { cd "${srcdir}"
tar -xfzv data.tar.gz mkdir -p "${pkgdir}/usr/" cp -r "${srcdir}/./usr/local/bin" "${pkgdir}/usr/bin" cp -r "${srcdir}/./usr/share" "${pkgdir}/usr/share"
chmod +x "${pkgdir}/usr/bin"/* sed 's|usr/local|usr|' -i "${pkgdir}/usr/bin"/* sed 's|usr/local|usr|' -i "${pkgdir}/usr/share/applications/LDM.desktop" }
echo "Now, been in your HOME directory, run: lmd -reconf and then run the program ;) enjoy it." echo "In some Websites, when downloading, the program says there was an error with the last page of the chapter, don't worry, coding mistake, that page was downloaded successfully"
# vim:set ts=2 sw=2 et:
The two "echo" at the end are to add two comments that I considered important things to know :) So... what do you thing about the PKGBUILD now? :)
No problem.
From the man page: "sed - stream editor for filtering and transforming text". Basically it's a non-interactive text editor. sed 's|usr/local|usr|' -i "${pkgdir}/usr/bin"/* changes every occurrence of "usr/local" with "usr" in all the files in ${pkgdir}/usr/bin. But only the first one in every line (I think). I assume it's needed because you app by default expects to be in /usr/local/bin while you install it in /usr/bin.
I may be wrong, but I think that the last echos will not be executed. If you want to display some messages after installation, use an install script. On a side note, please don't break the threads by. Also, most email clients can hide the quoted text, so no problem there either. And on another side note, sorry for top posting in my previous reply, I didn't notice it. --Chris Sakalis
ti, 2012-05-08 kello 21:03 +0200, Jorge Barroso kirjoitti: > source= > http://code.google.com/${pkgname}/downloads/detail?name=${pkgname}_${pkgver}_all.deb > ) there is the starting ( missing in there ^_^ > tar -xfzv data.tar.gz Nothing seroius but 'xf' is enought - is not needed, nor is z, tar is intelligent now days and can detect the compression on it's own. > echo "Now, been in your HOME directory, run: lmd -reconf and then run the > program ;) enjoy it." > echo "In some Websites, when downloading, the program says there was an > error with the last page of the chapter, don't worry, coding mistake, that > page was downloaded successfully" Well these should go to the install file. Create a file called ldm.install and set install=ldm.install in the PKGBUILD. Take a lookt at file /usr/share/pacman/proto.install, you should only needd the post_install function and put those echos in there :D PKGBUILD is used to build a pkgname-version-pkgrel.pkg.tar.xz package that you install with pacman. Pacman then reads the .install file from that package and does what it tells it to do and copies the files to the system. Most people are lilely to just install this from the AUR, so they would see that message. But in case say someone sends the redy built pacman package to a frind the friend would not saee that message, but if it is in install file he will. You are also missing the md5sums variable from the package. Run makepkg -g in the directoey where the PKGBUILD is and copy the output into the PKGBUILD. (I myself have an alias setup fot that. "makesum='makepkg -g >> PKGBUILD'" this gives me a command makesum that automatically appends the md5sums to the end of the PKGBUILD) Sed can do a lot of things. Basicly it reads text, does something to it and slips the mangled text out. 's|original|new|' for example would replaces every single word original with the word new. I think you should read these: https://wiki.archlinux.org/index.php/Pkgbuild https://wiki.archlinux.org/index.php/Makepkg https://wiki.archlinux.org/index.php/AUR And here is a werty comprehensive guide to sed. http://www.grymoire.com/Unix/Sed.html I myself can only use the replace command 's' XD
participants (3)
-
Chris Sakalis
-
Jesse Juhani Jaara
-
Jorge Barroso