Re: Specifying %{variable} in control file for use in postinst?
Thomas Goirand tho...@goirand.fr writes: - Original message - We were talking about dpkg-parsechangelog. MfG Â Â Â Â Â Â Â Â Goswin Are you saying that dpkg-parsechangelog must also be available in RedHat like distros? Sorry, I didn't get it, but now I think you are quite right. Thomas I don't see any reason why a package could not do the srpm equivalent of Build-Depends: dpkg-dev and use dpkg-parsechangelog. Srpm does have Build-Depends, right? MfG Goswin -- To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/87r5lqbvse@frosties.localdomain
Re: Specifying %{variable} in control file for use in postinst?
Goswin von Brederlow wrote: Thomas Goirand tho...@goirand.fr writes: Srpm does have Build-Depends, right? MfG Goswin Sure! It's called BuildRequires: in the spec files. Thomas -- To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/4be14a81.2000...@goirand.fr
Re: Specifying %{variable} in control file for use in postinst?
- Original message - We were talking about dpkg-parsechangelog. MfG Goswin Are you saying that dpkg-parsechangelog must also be available in RedHat like distros? Sorry, I didn't get it, but now I think you are quite right. Thomas -- To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/1272954778.1439.2.ca...@nokia-n900-42-11
Re: Specifying %{variable} in control file for use in postinst?
156 lines of twisted pre-processing bash code but it works. You can do a strange merged deb/rpm structure as follows: ~/mypackagedir/distrospecificfilesdir ~/mypackagedir/SPECS ~/mypackagedir/SOURCES ~/mypackagedir/RPMS etc for rpm. ~/mypackagedir/mypackagedir ~/mypackagedir/mypackagedir/DEBIAN ~/mypackagedir/mypackagedir/mypackageroot Additionally you can bundle all of the spec file and preprocessing bash scripts all into DEBIAN since they do not take up much space. I am going to try to symlink DEBIAN to SPECS and see if it works. I haven't tried it yet. The above is a way you can mush it all together into one common subdirectory for both rpm and deb building then move it around without too much pain from one system to another with the less duplication. -- IV On Sat, May 1, 2010 at 12:07 PM, Ignacio Valdes ival...@hal-pc.org wrote: Moving on. As suggested I am simply going to have to hack/kludge rpm and deb with a bunch of sed pre-processing of the respective spec, control and postinst to make it work. These two divergent schemes put a large burden of effort on developers and documenters. Wish I could get deb and rpm folks in the same room and say: can you make this easier to do cross-platform work with both these package systems like linux filesystem standard? DEBIAN is roughly equivalent to SPECS: change to a common third like PACK. SOURCES is practically the same as the root of DEBIAN, change to a common scheme. Unify control file and spec header names they are practically the same thing. -- IV -- To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/y2i311679a81005042017te068f6bby4127a27a2a621...@mail.gmail.com
Re: Specifying %{variable} in control file for use in postinst?
Thomas Goirand tho...@goirand.fr writes: Russ Allbery wrote: Thomas Goirand tho...@goirand.fr writes: then in your debian/rules build rule, you can do something like: MY_VERS=`head -n 1 debian/changelog | cut -d'(' -f2 | cut -d')' -f1 | cut -d'-' -f1` MY_DEB_REL=`head -n 1 debian/changelog | cut -d'(' -f2 | cut -d')' -f1 | cut -d'-' -f2` MY_PKGNAME=`head -n 1 debian/changelog | cut -d' ' -f1` dpkg-parsechangelog makes this somewhat easier and more robust. Yes, but I'm using this in both deb and rpm building, and of course, dpkg-parsechangelog is not available in RPM based distros. Thomas Then change that. :) We have rpm in Debian. Let them have dpkg. MfG Goswin -- To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/87r5ltpf5s@frosties.localdomain
Re: Specifying %{variable} in control file for use in postinst?
Goswin von Brederlow wrote: Then change that. :) We have rpm in Debian. Let them have dpkg. MfG Goswin As much as I know, dpkg and debootstrap are both available as RPM packages for CentOS. But that doesn't mean you can use dpkg to install stuffs on your system. RPM and dpkg dbs are really different (now, they use sqlite, as much as I understood). As for yum and rpm in Debian. I'm the maintainer of yum, and I quite know that it's use is only to setup other distros in chroots. Anyway, do not worry, I am a Debian fan! :) Thomas -- To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/4bde9dd2.8070...@goirand.fr
Re: Specifying %{variable} in control file for use in postinst?
Thomas Goirand tho...@goirand.fr writes: Goswin von Brederlow wrote: Then change that. :) We have rpm in Debian. Let them have dpkg. MfG Goswin As much as I know, dpkg and debootstrap are both available as RPM packages for CentOS. But that doesn't mean you can use dpkg to install stuffs on your system. RPM and dpkg dbs are really different (now, they use sqlite, as much as I understood). As for yum and rpm in Debian. I'm the maintainer of yum, and I quite know that it's use is only to setup other distros in chroots. Anyway, do not worry, I am a Debian fan! :) Thomas We were talking about dpkg-parsechangelog. MfG Goswin -- To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/87tyqo9wm5@frosties.localdomain
Re: Specifying %{variable} in control file for use in postinst?
Russ Allbery wrote: Thomas Goirand tho...@goirand.fr writes: then in your debian/rules build rule, you can do something like: MY_VERS=`head -n 1 debian/changelog | cut -d'(' -f2 | cut -d')' -f1 | cut -d'-' -f1` MY_DEB_REL=`head -n 1 debian/changelog | cut -d'(' -f2 | cut -d')' -f1 | cut -d'-' -f2` MY_PKGNAME=`head -n 1 debian/changelog | cut -d' ' -f1` dpkg-parsechangelog makes this somewhat easier and more robust. Yes, but I'm using this in both deb and rpm building, and of course, dpkg-parsechangelog is not available in RPM based distros. Thomas -- To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/4bdd251e.2030...@goirand.fr
Re: Specifying %{variable} in control file for use in postinst?
Ignacio Valdes wrote: So here is the use case, one that to my knowledge rpm or deb do not provide much guidance for and deb does not provide control fields for: Package is a vehicle for installing software that can create multiple instances. Further, those instances can be very long lived (decades) and almost certainly will be updated and migrated in the future to new hardware and software. Finally that in the case of a catastrophic failure, the metadata of the rpm/deb file such as name of the rpm/deb file and versions that created it are barcoded redundantly with the instance in an a instance env file that rides within the instance directory tree in a known location in order to facilitate recovery and maintenance (this last part is already worked out). Both rpm and dpkg support setting-up in chroots. rpm because it can access the spec file header information this is pretty easy to do. For deb this looks like I am going to have to parse the control file to get this information out. Is there any bash control file parsers out there? No, parsing the control file might be dangerous, there's nothing that tells you it wont change format in the future. What's best is to generate variable for use in your postinst. My example parses the top of the debian/changelog, but you could do the same with debian/control #!/bin/sh set -e PKG_NAME=__PKG_NAME__ PKG_VERS=__PKG_VERS__ PKG_DEB_REL=__PKG_DEB_REL__ then in your debian/rules build rule, you can do something like: MY_VERS=`head -n 1 debian/changelog | cut -d'(' -f2 | cut -d')' -f1 | cut -d'-' -f1` MY_DEB_REL=`head -n 1 debian/changelog | cut -d'(' -f2 | cut -d')' -f1 | cut -d'-' -f2` MY_PKGNAME=`head -n 1 debian/changelog | cut -d' ' -f1` sed s/__PKG_NAME__/${MY_PKGNAME}/ debian/master.postinst debian/postinst.temp sed -i s/__PKG_DEB_REL__/${MY_DEB_REL}/ debian/postinst.temp sed s/__PKG_VERS__/${MY_PKGNAME}/ debian/postinst.temp debian/postinst Of course, your clean target should remove debian/postinst.temp and debian/postinst that way, you can get the variables you need available in your postinst in a not too ugly way. I believe you can also do the same for debian/config and all the other maintainer scripts in general. If you find this very hard to do and think it could have been made more, simple, well as many highlighted, in a normal situation you don't need to have access to all of this. Thomas -- To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/4bdbd155.2060...@goirand.fr
Re: Specifying %{variable} in control file for use in postinst?
Moving on. As suggested I am simply going to have to hack/kludge rpm and deb with a bunch of sed pre-processing of the respective spec, control and postinst to make it work. These two divergent schemes put a large burden of effort on developers and documenters. Wish I could get deb and rpm folks in the same room and say: can you make this easier to do cross-platform work with both these package systems like linux filesystem standard? DEBIAN is roughly equivalent to SPECS: change to a common third like PACK. SOURCES is practically the same as the root of DEBIAN, change to a common scheme. Unify control file and spec header names they are practically the same thing. -- IV -- To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/l2q311679a81005011007r7b5f677bk4942a416f0bcd...@mail.gmail.com
Re: Specifying %{variable} in control file for use in postinst?
Thomas Goirand tho...@goirand.fr writes: then in your debian/rules build rule, you can do something like: MY_VERS=`head -n 1 debian/changelog | cut -d'(' -f2 | cut -d')' -f1 | cut -d'-' -f1` MY_DEB_REL=`head -n 1 debian/changelog | cut -d'(' -f2 | cut -d')' -f1 | cut -d'-' -f2` MY_PKGNAME=`head -n 1 debian/changelog | cut -d' ' -f1` dpkg-parsechangelog makes this somewhat easier and more robust. -- Russ Allbery (r...@debian.org) http://www.eyrie.org/~eagle/ -- To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/8763375rmy@windlord.stanford.edu
Re: Specifying %{variable} in control file for use in postinst?
So I am gathering that whereas it is repugnant to the dpkg design scheme to do it, but for the sake of rpm reconciliation the thread subject question: accessing control file values in postinst is not simple to do other than with major changes like sed pre-processing and such? Is that the situation? I need to decide this soon and move on. -- IV On Fri, Apr 30, 2010 at 11:03 AM, Kris Deugau kdeu...@vianet.ca wrote: Ignacio Valdes wrote: Required to produce versions for both rpm and deb. No introspection means not easy to convert this from rpm to deb which is where this started. This would make it much easier to produce both deb and rpm versions if it has the ability to introspect those variables. If all you're looking to do is produce .rpm and .deb package files for distribution from your own site, you might want to see if a script I wrote will meet your needs: http://deepnet.cx/debbuild/ It takes a .spec and creates a .deb package file. Please note: it does **NOT** create a Debian package, it creates a .deb package that should install reasonably sanely on Debian and derivative systems. Someday I'd like to expand it to write Debian packaging metadata that regular Debian packaging tools can use, but that's not happening any time soon. -kgd -- To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/n2p311679a81004300912p4c1c91b0j83fa9f0258a5b...@mail.gmail.com
Re: Specifying %{variable} in control file for use in postinst?
On Friday 30 April 2010 11:12:57 Ignacio Valdes wrote: So I am gathering that whereas it is repugnant to the dpkg design scheme to do it, but for the sake of rpm reconciliation the thread subject question: accessing control file values in postinst is not simple to do other than with major changes like sed pre-processing and such? I wouldn't say it is repugnant, but the postinst scripts should generally be able to be run independently of even having the control fields available. I also wouldn't say that sed pre-processing at .deb build time is a major change. Is that the situation? Yes, dpkg does not (currently) expose the control fields in the environment that the {pre,post}{inst,rm} scripts are run. -- Boyd Stephen Smith Jr. ,= ,-_-. =. b...@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/\_/ signature.asc Description: This is a digitally signed message part.
Re: Specifying %{variable} in control file for use in postinst?
So here is the use case, one that to my knowledge rpm or deb do not provide much guidance for and deb does not provide control fields for: Package is a vehicle for installing software that can create multiple instances. Further, those instances can be very long lived (decades) and almost certainly will be updated and migrated in the future to new hardware and software. Finally that in the case of a catastrophic failure, the metadata of the rpm/deb file such as name of the rpm/deb file and versions that created it are barcoded redundantly with the instance in an a instance env file that rides within the instance directory tree in a known location in order to facilitate recovery and maintenance (this last part is already worked out). rpm because it can access the spec file header information this is pretty easy to do. For deb this looks like I am going to have to parse the control file to get this information out. Is there any bash control file parsers out there? -- IV On Fri, Apr 30, 2010 at 12:58 PM, Boyd Stephen Smith Jr. b...@iguanasuicide.net wrote: On Friday 30 April 2010 11:12:57 Ignacio Valdes wrote: So I am gathering that whereas it is repugnant to the dpkg design scheme to do it, but for the sake of rpm reconciliation the thread subject question: accessing control file values in postinst is not simple to do other than with major changes like sed pre-processing and such? I wouldn't say it is repugnant, but the postinst scripts should generally be able to be run independently of even having the control fields available. I also wouldn't say that sed pre-processing at .deb build time is a major change. Is that the situation? Yes, dpkg does not (currently) expose the control fields in the environment that the {pre,post}{inst,rm} scripts are run. -- To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/s2q311679a81004301119yd69e5908qdacb45a20cbff...@mail.gmail.com