Thread: weird bug in rebuilding RPMs
Hello, I'm a long time user and I had always installed postgres by compiling from source. I recently moved to a new environment where everything is installed as rpm and plus I need to install a newer postgres for testing while keeping the existing version in place. That leads me to repackage postgres rpm. Because I will eventually be installing red hat rpm I take their latest srpm and modify their rpm spec file in order to let me install rpm. After trials and errors I have managed to rebuild rpm to my satisfaction but would like to report a minor bug. I can now rebuild rpms so that all files go under a specific directory specified by _prefix directive in ~/.rpmmacros Forgetting lots of other bugs that I managed to fix, this weird bug is making me use _prefix that does not include the word "pgsql" in the path name any where. For example if _prefix path has the word pgsqL or pgsq or pgsqA then rebuilding is successful but if the path includes the word pgsql or pgsql-8.1.18 or pgsqll then rebuilding breaks down. It is failing at install stage. This is the command. $ rpmbuild --bi spec I always do "rpmbuild --clean spec" before any rebuilding. What follows is the error message before it quits (prefix is /usr/local/pgsql/bla) ------------- make: Leaving directory `/home/me/build/BUILD/postgresql-8.1.18/contrib/xml2' + case `uname -i` in ++ uname -i ++ uname -i + mv /var/tmp/postgresql-8.1.18-2.1-root//usr/local/pgsql/bla/include/pg_config.h /var/tmp/postgresql-8.1.18-2.1-root//usr/local/pgsql/bla/include/pg_config _x86_64.h + install -m 644 /home/me/build/SOURCES/pg_config.h /var/tmp/postgresql-8.1.18-2.1-root//usr/local/pgsql/bla/include ++ uname -i + mv /var/tmp/postgresql-8.1.18-2.1-root//usr/local/pgsql/bla/include/pgsql/server/pg_config.h /var/tmp/postgresql-8.1.18-2.1-root//usr/local/pgsql/bla/incl ude/pgsql/server/pg_config_x86_64.h mv: cannot stat `/var/tmp/postgresql-8.1.18-2.1-root//usr/local/pgsql/bla/include/pgsql/server/pg_config.h': No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.56667 (%install) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.56667 (%install) ------------- If any one else would find it useful, I can also post a diff of the spec file which will make it possible for repackaging and including renaming so that it does not override the existing version. Most bugs I encountered are of the nature: paths that should not be hard-coded are hard-coded and vice versa. Thanks mr.wu
zhong ming wu escribió: > I can now rebuild rpms so that all files go under a specific directory > specified by _prefix directive in ~/.rpmmacros Forgetting lots of > other bugs that I managed to fix, this weird bug is making me use > _prefix that does not include the word "pgsql" in the path name any > where. For example if _prefix path has the word pgsqL or pgsq > or pgsqA then rebuilding is successful but if the path includes the > word pgsql or pgsql-8.1.18 or pgsqll then rebuilding breaks down. Yeah, the Makefiles contain a trick to put append "/pgsql" to the include dir (and others) if the prefix does not already contain "pgsql" or "postgresql" or similar. This is probably what is causing the build to fail. See src/Makefile.global.in: ########################################################################## # # Installation directories # # These are set by the equivalent --xxxdir configure options. We # append "postgresql" to some of them, if the string does not already # contain "pgsql" or "postgres", in order to avoid directory clutter. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.
Alvaro Herrera <alvherre@commandprompt.com> writes: > zhong ming wu escribi�: >> I can now rebuild rpms so that all files go under a specific directory >> specified by _prefix directive in ~/.rpmmacros Forgetting lots of >> other bugs that I managed to fix, this weird bug is making me use >> _prefix that does not include the word "pgsql" in the path name any >> where. > Yeah, the Makefiles contain a trick to put append "/pgsql" to the > include dir (and others) if the prefix does not already contain "pgsql" > or "postgresql" or similar. This is probably what is causing the build > to fail. See src/Makefile.global.in: Yeah, I suspect that the RPMs depend in various ways on the assumption that those pathname substitutions will happen. I haven't got round to testing, but it might be a good idea to change rpm-pgsql.patch to make the substitutions unconditional, so that the file layout below the _prefix is fixed regardless of what the _prefix is. But having said that, I don't get the point of trying to build a nonstandard installation from the RPM. That seems more or less antithetical to most of the design concepts of RPM-based distros; and it certainly seems pretty silly if your intent is to transition to the standard RPM later. regards, tom lane
On Mon, 2010-02-08 at 10:33 -0500, Tom Lane wrote: > But having said that, I don't get the point of trying to build a > nonstandard installation from the RPM. That seems more or less > antithetical to most of the design concepts of RPM-based distros; > and it certainly seems pretty silly if your intent is to transition > to the standard RPM later. Right. Also, I think using _prefix is not supported? Isn't it considered as relocation of postgresql rpm? -- Devrim GÜNDÜZ Professional PostgreSQL Services, Training, 24x7 Support Authors: PostgreSQL RPMs, PITRTools, PostgreSQL Replicator http://www.commandprompt.com/ XMPP: dgunduz@jabber.commandprompt.com Twitter: http://twitter.com/devrimgunduz