From a67d9ea36a706447ef382b41486c7a5b2607e41c Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Wed, 21 Feb 2018 21:32:12 +0100 Subject: [PATCH] initial push Signed-off-by: Toshaan Bharvani --- ChangeLog | 1060 +++++++++++++++++++++++++++++++++ Makefile | 26 + brp-compress | 56 ++ brp-implant-ident-static | 34 ++ brp-java-repack-jars | 99 +++ brp-python-hardlink | 19 + brp-strip | 14 + brp-strip-comment-note | 23 + brp-strip-shared | 20 + brp-strip-static-archive | 16 + dist.sh | 83 +++ find-provides | 112 ++++ find-provides.d/firmware.prov | 14 + find-provides.d/modalias.prov | 76 +++ find-provides.ksyms | 9 + find-provides.libtool | 10 + find-provides.pkgconfig | 22 + find-requires | 160 +++++ find-requires.ksyms | 48 ++ find-requires.libtool | 15 + find-requires.pkgconfig | 11 + kmodtool | 267 +++++++++ macros | 274 +++++++++ rpmrc | 80 +++ rpmsort | 76 +++ symset-table | 40 ++ 26 files changed, 2664 insertions(+) create mode 100644 ChangeLog create mode 100644 Makefile create mode 100755 brp-compress create mode 100755 brp-implant-ident-static create mode 100755 brp-java-repack-jars create mode 100755 brp-python-hardlink create mode 100755 brp-strip create mode 100755 brp-strip-comment-note create mode 100755 brp-strip-shared create mode 100755 brp-strip-static-archive create mode 100755 dist.sh create mode 100755 find-provides create mode 100644 find-provides.d/firmware.prov create mode 100644 find-provides.d/modalias.prov create mode 100755 find-provides.ksyms create mode 100755 find-provides.libtool create mode 100755 find-provides.pkgconfig create mode 100755 find-requires create mode 100755 find-requires.ksyms create mode 100755 find-requires.libtool create mode 100755 find-requires.pkgconfig create mode 100755 kmodtool create mode 100644 macros create mode 100644 rpmrc create mode 100755 rpmsort create mode 100755 symset-table diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..c2e29ed --- /dev/null +++ b/ChangeLog @@ -0,0 +1,1060 @@ +commit d53f48cc840cff16719765d7126e7b87db7bd948 +Author: Panu Matilainen +Date: Tue Feb 2 11:24:04 2010 +0200 + + Tarball creation tweaks + - add ChangeLog to tarballs + - make tagging non-interactive + - silence the tarball generation commands + +commit c73da1f920930dc6d10e0b8a347ddcaf689bca66 +Author: Panu Matilainen +Date: Tue Jan 26 17:33:19 2010 +0200 + + Leave rpm's hkp keyserver configuration alone + - rpm < 4.6 used to try and fetch and import any missing keys from + keyserver automatically on rpmdb iteration if hkp_keyserver was set, which + caused hideous slowdowns and huge load on pgp keyservers AND was a + security hazard as rpm thinks imported == trusted key. This is safe + enable now as rpm will only ever import keys when explicitly told to do + so with --import + - this makes pgp import directly from PGP servers work, ie + 'rpm --import 0x' + +commit 631ba9b6fe498fbc1e2a9c5f2955b4fa7a174a8c +Author: Panu Matilainen +Date: Tue Jan 26 17:27:54 2010 +0200 + + Use $(NAME) instead of hardwired name everywhere in makefile + +commit a11368f98aa987913ede2d1d4207d99cac08c5e6 +Author: Panu Matilainen +Date: Tue Jan 26 16:09:35 2010 +0200 + + Remove config.guess and config.sub + - these used to have RH-specific hacks in them and %configure used to + copy updated versions to builddir on invocation but neither is done + now, these are just copies of upstream (libtool / automake) versions + so there's no point dragging them along + - some packages might expect to find them in /usr/lib/rpm/redhat/ so + perhaps spec should copy them at build-time from automake/libtool + to ensure a recent version + +commit de76474f3520ec1ebad85b2ad8263bc7da870b95 +Author: Panu Matilainen +Date: Tue Jan 26 15:52:39 2010 +0200 + + Remove "upstream reference" spec file + - this makes no sense as the spec needs to be separately maintained + for distribution versions separately anyway + +commit 7ec7e86b74528b69018fb0c18776ab12d1806044 +Author: Panu Matilainen +Date: Tue Jan 26 15:51:57 2010 +0200 + + Set version directly in Makefile (and bump the version) + +commit 1d1bd8e3cb31ef6448c811ea467bc05cbc01f217 +Author: Panu Matilainen +Date: Tue Jan 26 15:40:02 2010 +0200 + + Remove ancient and unused brp-redhat script + - this was last used eons ago somewhere in rpm 3.x - 4.[01] era + +commit 9d5f7858ba3fadc6372dd692720bde57e510ed2b +Author: Panu Matilainen +Date: Tue Jan 26 14:42:20 2010 +0200 + + rpm >= 4.6.0 doesn't process macrofiles: from rpmrc anymore, remove + - macrofiles: is silently ignored by recent rpm versions, remove the + useless setting to avoid possible confusion + +commit 2a452bba1e3c24e25b6310d6538b56f33634925a +Author: Panu Matilainen +Date: Tue Jan 26 13:55:54 2010 +0200 + + Permit using different python version for brp-python-bytecompile (#521141) + - pass %{__python} macro to brp-python-bytecompile instead of using + hardwired /usr/bin/python, as suggested by Bowe Strickland + +commit bda00a1a70b5c006eef55c19bbe8530f0b1f5e6e +Author: Panu Matilainen +Date: Fri Jan 22 17:09:57 2010 +0200 + + Use rpm's perl dependency extractors + - rpm's dep extractors have gotten numerous improvements over the years, + while the ones here haven't seen any updates since 2002 + - point the find-* scripts to rpm's scripts, remove the redundant and + outdated perl.* scripts + +commit ca3cae8695a41600cd274acd49120bdc9a7c6a06 +Author: Panu Matilainen +Date: Fri Jan 22 16:27:43 2010 +0200 + + Make peace with newer git + +commit c57d60b64ee2515f93ffd118f715cd97bca0fca9 +Author: Panu Matilainen +Date: Fri Jan 22 16:25:45 2010 +0200 + + Remove unused CVSROOT variable from Makefile + +commit f359c096c229bc7b44b5eded5ee6e79ce7e8f1d7 +Author: Panu Matilainen +Date: Fri Jan 22 15:59:04 2010 +0200 + + Remove redundant %find_lang definition + - this was only useful back when we were using our own find-lang.sh + +commit 4c01ac82e67f95857f697079c65966023f400820 +Author: Panu Matilainen +Date: Fri Jan 22 15:55:11 2010 +0200 + + Remove brp-sparc64-linux blast from the past + - kludgery like this might've been necessary back in 2000 to get started + with multilib setup but it certainly isn't needed now + +commit 56ed371d31e3f07d3a2ecab953769a55cb6cbbad +Author: Panu Matilainen +Date: Fri Jan 22 15:47:15 2010 +0200 + + Remove redundant and deprecated %_initrddir definition (#455279) + - this has been provided by rpm since forever, no need to carry it here + +commit 850eda59f82406f05dfe9d070ab4a32cdfd39e3b +Author: Panu Matilainen +Date: Fri Jan 22 15:43:38 2010 +0200 + + Disable autotools dependency tracking in %configure (#496522) + - autotools dependency tracking isn't generally useful in rpm builds; + disabling it results in cleaner build logs and possibly slight build speedups + - patch from Ville Skyttä + +commit c9d2ffe12342fb6dee7d45584a986cc049fb9a01 +Author: Panu Matilainen +Date: Fri Jan 22 15:39:38 2010 +0200 + + Don't set --target in %configure (#458648) + - --target is only ever useful for handful of compiler toolchain packages + and cross-compiler packages are better off setting it themselves if + necessary, rpm messing here only gets in the way + - patch originally from Stepan Kasal + +commit f2e3413ddb57dd005d6dadfd8c9fe4e8cba01a66 +Author: Panu Matilainen +Date: Fri Jan 22 15:34:07 2010 +0200 + + Enable overriding the default ./configure path of %configure (#489942) + - syncs up with rpm upstream setup + - FFLAGS has a Fedora-specific override forcing us to carry this %configure + copy, need to fix rpm to permit more fine-grained overrides... + +commit b5b2aedbc1df3175ebd3babbe08e51cede07b4ef +Author: Panu Matilainen +Date: Fri Jan 22 15:30:02 2010 +0200 + + Add filtering framework for external dependency generator (#516240) + - patch from Chris Weyl + +commit 82f9946bc0fef76f89fb467534a760f8305e78d7 +Author: Panu Matilainen +Date: Fri Jan 22 15:26:58 2010 +0200 + + Speed up static archive stripping processing (#517101) + - only bother processing files named *.a instead of everything in buildroot + - patch from Adam Jackson + +commit e56e816f4708b2bf71f7f94e437a5a2463c3c5cc +Author: Panu Matilainen +Date: Fri Jan 22 15:25:17 2010 +0200 + + Enable use of XZ compression for binary rpm payloads + - as per https://fedoraproject.org/wiki/Features/XZRpmPayloads + - lowish compression preset level to keep deltarpm rebuild time tolerable + - source rpms dont really benefit from XZ compression as the contents are + typically tarballs which are already compressed + - patch from Bill Nottingham + +commit 159a65fb611beb4851efe96dbf1a7ced8859b7be +Author: Panu Matilainen +Date: Fri Jan 22 15:24:29 2010 +0200 + + Ensure empty buildroot for %install + - remove any existing buildroot contents and safely create a new one + - patch originally from OpenSUSE / Michael Schroeder, adopted to Fedora + by Tom "spot" Callaway + +commit f9c0aca4aef1c8d5d52dc1e190be7c25115e96fd +Author: Panu Matilainen +Date: Fri Jan 22 15:15:22 2010 +0200 + + Make i686 the default x86 architecture, optimize for Atom CPU + - as per http://fedoraproject.org/wiki/Features/F12X86Support + - patch from Bill Nottingham + +commit e2a80f379c269762117b406a9a078062760f2b0d +Author: Panu Matilainen +Date: Fri Jan 22 15:07:55 2010 +0200 + + Change default hashing algorithm in file digests to SHA-256 (#485826) + - as per https://fedoraproject.org/wiki/Features/StrongerHashes + - patch from Miloslav Trmač + +commit 5c981d50724c15d1cf98b836f54c9183bb283f22 +Author: Panu Matilainen +Date: Fri Jan 22 15:03:53 2010 +0200 + + Fedora 11 default buildflags + - as per http://fedoraproject.org/wiki/Features/ArchitectureSupport + - set 32 bit intel build arch to i586 on compatible hardware + - set 32 bit sparc build arch to sparcv9 on compatible hardware + - add missing armv7l arch + - set the default build arch to match fedora arm build target + +commit 3a2d93f3119168b4b46d3eb37fed9355f51dd8c2 +Author: Panu Matilainen +Date: Fri Jan 22 15:02:51 2010 +0200 + + Limit _smp_mflags to max 16 + - patch from Dennis Gilmore + +commit ab5323242024fceaae33e47d48245910ec88fdab +Author: Panu Matilainen +Date: Fri Jan 22 11:22:07 2010 +0200 + + Handle JAR files containing filenames with spaces (#243157, #461854, #547704) + - patch originally from Peter Bieringer + +commit afe45959fba91d9d693c8d7502d30917aa032850 +Author: Panu Matilainen +Date: Fri Jan 22 10:59:42 2010 +0200 + + Dont try to repack empty JAR's (#269481, #547699) + - patch originally from Kai Bolay + +commit 9ed9b4e3459e3125befd324f579f751a239c26ca +Author: Jonathan Masters +Date: Tue May 6 19:08:20 2008 -0400 + + A variety of small cleanups + +commit fcf5e22a650b1a29b69c2d2f27bfb16f679580f8 +Author: Jon Masters +Date: Thu Apr 3 03:14:54 2008 -0400 + + Bump the release. + +commit 83405d773d2b0ee282dbed07353354dfce0df9b8 +Author: Jon Masters +Date: Thu Apr 3 03:11:24 2008 -0400 + + Update config.guess|sub, sync with RHEL-5. + +commit 0c5255b6381833ba582188b71ed2ab16f22fa706 +Author: Jon Masters +Date: Thu Apr 3 02:46:05 2008 -0400 + + Set package_name correctly. + +commit 75220114eb9cead135ca546aa30296bd9a44abe8 +Author: Jeremy Katz +Date: Thu Jul 5 14:34:42 2007 -0400 + + conflict instead of requires + +commit e284fd4907967ad2d796e42b3c1f53bd6e2e8d94 +Author: Jesse Keating +Date: Thu Jul 5 12:45:59 2007 -0400 + + Clean up dist junk; require right aged rpm (remove at F8 final time?) + +commit 9b11fc216b5153969ae78c19d293644d9495a370 +Author: Jesse Keating +Date: Thu Jul 5 12:41:21 2007 -0400 + + Enable buildroot check by default + +commit 59155fec98cab9df1d8cecb88407903e6675e3fe +Author: Jeremy Katz +Date: Tue Jun 19 14:52:55 2007 -0400 + + bump version, add %dist bits, add lost changelog entries + +commit 9ffd96965483401331db5bc6a0184ef7c7273b37 +Author: Jeremy Katz +Date: Tue Jun 19 14:38:34 2007 -0400 + + use stock find-lang rather than the (old) copy (#213041) + +commit d82d89ec837705583b4af019c4549f00034f79a2 +Author: Jeremy Katz +Date: Tue Jun 19 14:36:18 2007 -0400 + + %{_gnu} gets defined in the platform definitions and _shouldn't_ be + -gnu on some arm arches (Lennert Buytenhek, #243523) + +commit 6b022102df774c5a11548346c2a2b673a68cffb5 +Author: Jeremy Katz +Date: Tue Jun 19 14:35:57 2007 -0400 + + define optflags for modern arm arches (Lennert Buytenhek, #243523) + +commit e54f487738b9a0b01ef25260800ceaee3971403a +Author: Jeremy Katz +Date: Tue Jun 19 14:35:41 2007 -0400 + + report gnueabi if appropriate for arm (Lennert Buytenhek, #243523) + +commit 85ff3763b6d0a8bc16e44064efba1c78b9187e8d +Author: Jeremy Katz +Date: Tue Jun 19 14:28:50 2007 -0400 + + allow disabling jar repacking (#219731) + +commit 1b84f70101d2f01f74165a7047b77bb4bb9d6d25 +Author: Jeremy Katz +Date: Tue Jun 19 14:24:12 2007 -0400 + + fix dist.sh --fc (#223651) + +commit a959c1f92d55d1829a6b1c3d45d765d8a4129551 +Author: Jeremy Katz +Date: Tue Jun 19 14:20:53 2007 -0400 + + hardlink identical .pyc and .pyo files to save some space. patch from + Ville Skyttä + +commit 9f4238cef901ddf7aa9e249cac5297b529606a2b +Author: Jeremy Katz +Date: Tue Jun 19 14:16:16 2007 -0400 + + fix usage of TMPDIR (mattdm, #235614) + +commit 1b6281ab55613ba30a42c8888226098b108aa3d6 +Author: Jeremy Katz +Date: Tue Jun 19 13:54:21 2007 -0400 + + add install and clean targets to makefile. make the spec file be normal + instead of doing everything manually + +commit 5b4d287b6bcf99976c9e8aa1fdf132b22e4d4dfb +Author: Jeremy Katz +Date: Tue Jun 19 13:53:46 2007 -0400 + + fix the permissions on these as well so that we're not oding it from the spec + file + +commit 33fb6e3b6605600813401e56e97c80db80aba719 +Author: Jeremy Katz +Date: Tue Jun 19 13:50:17 2007 -0400 + + use git bits for making the archive + +commit 19f1cde13bb14f6d92c55d12b73acf04eaa0235b +Author: Jeremy Katz +Date: Tue Jun 19 13:42:44 2007 -0400 + + fix perms + +commit acfbad4bf7d5bcd26e0ab2b48eb25ce201a0ae08 +Author: Jeremy Katz +Date: Tue Jun 19 15:42:48 2007 +0000 + + bump spec file + +commit 95521bebac1aaca719bd99dbf055e5c4e67b3932 +Author: Jeremy Katz +Date: Tue Jun 19 15:23:29 2007 +0000 + + add support for find-provides.d dir; use for modalias tracking (from jcm) + +commit feffba404a7ca764e403c7f27b4e18da939f4a32 +Author: Jeremy Katz +Date: Tue Jun 19 15:21:46 2007 +0000 + + add support for kmps/kmodtool stuff (from jcm) + +commit 48c39c99dc02c52d67038cefd7610b24cf79c5f1 +Author: Jeremy Katz +Date: Tue Jun 19 15:18:25 2007 +0000 + + patch from jcm to adjust kmod handling + +commit e053cecd416d037659dd8f933e9f1a3a418e0fa6 +Author: Jeremy Katz +Date: Tue Jun 19 15:13:23 2007 +0000 + + add script that does repacking of jar files to avoid multilib conflicts. + originally written by Ben Konrath + +commit 97a32887d64bc2cbc7b6f04a07cb8f13544934bd +Author: Jon Masters +Date: Thu Oct 12 03:33:42 2006 +0000 + + Update upstream redhat-rpm-config release. + +commit c8ec9fb01f33746c8770ecfb31bd938e35490c74 +Author: Jeremy Katz +Date: Fri Feb 3 23:00:26 2006 +0000 + + use -mtune=generic for x86 and x86_64 + +commit 12233c1d7bc20c6230e84a6142cfa0adf40601db +Author: Elliot Lee +Date: Wed Aug 17 00:27:33 2005 +0000 + + fix #165416 + +commit d3e0d601f6af5e38e23242d5b3ba66fbb7f5c82d +Author: Elliot Lee +Date: Mon Aug 1 17:54:09 2005 +0000 + + add wall back in + +commit d5e4ed68cb77afc6bf93dba94b605046d8255ffa +Author: Elliot Lee +Date: Mon Aug 1 17:53:18 2005 +0000 + + add wall back in + +commit 1986646f8544c9f84b8c3b07c151e581daf08a99 +Author: Elliot Lee +Date: Mon Aug 1 17:44:57 2005 +0000 + + 8.0.37: + + On Fri, 29 Jul 2005, Ulrich Drepper wrote: + + > Please find attached the hopefully final changes for the compile flags. + > It's a patch against redhat-rpm-config-8.0.36-1.src.rpm. The changes are: + > + > ~ enable stack protector with minimal size 4 (default is 8, too high + > IMO). Vlad ran some tests on SPEC. SPEC is highly CPU intensive, + > unlike 90%+ of the distribution. Even in those tests the performance + > decrease was below 1%, probably even in the noise. Especially the + > decrease of the minimum size to 4 made no measurable impact. + > + > ~ remove the -fsigned-char flag for ppc. glibc has not been compiled + > with the flag anyway, so if anything changes, we eliminate some bugs. + > The only theoretical issue would be if a library we ship uses CHAR_MAX + > in an interface. I personally haven't seen this for good reasons. + > The only interface I know is localeconv(3) in glibc and this interface + > is now corrected. + > + > ~ minor fix for SPARC + +commit f20fd095421a750491811388ce17517035448417 +Author: Elliot Lee +Date: Thu Jun 16 15:42:31 2005 +0000 + + fix + +commit b8c7c4c827f4f5ddbdf735cba1e072a3ffa82989 +Author: Elliot Lee +Date: Wed Jun 15 22:18:12 2005 +0000 + + Enable python, pkgconfig provides + +commit 5fc6cf03a1585a5829f9ad90b991ae63443c4d0f +Author: Elliot Lee +Date: Fri Jun 10 17:19:17 2005 +0000 + + fix 159117 + +commit 1a959d38c8ca8bea6e932c068a49107f15763102 +Author: Elliot Lee +Date: Thu Apr 7 03:10:39 2005 +0000 + + fix #129025 + +commit 259bb7270c10dfc42922139c16555767d129c477 +Author: Elliot Lee +Date: Thu Mar 24 20:10:06 2005 +0000 + + add dist.sh + +commit ded130c1dd5a1c1aa16f3c18fb41211184a993a4 +Author: Elliot Lee +Date: Wed Mar 23 20:05:40 2005 +0000 + + new version + +commit 6eb38ebaff708ffa7e40a9010dc02592ce9df7dd +Author: Elliot Lee +Date: Wed Mar 23 19:52:10 2005 +0000 + + new version + +commit f41aa8c35fb2fb638772c036a24ad56089baef5f +Author: Elliot Lee +Date: Tue Mar 22 03:30:56 2005 +0000 + + #147961 + +commit 1518ff2d14377c05ecf7cf9428e42964516883b4 +Author: Elliot Lee +Date: Wed Feb 9 15:09:11 2005 +0000 + + Fix java builds + +commit 89e3065f19c3763e3cb768759ce106292c445ec6 +Author: Elliot Lee +Date: Fri Dec 3 19:28:33 2004 +0000 + + Add ppc64[ip]series optflags + +commit f8bcd4e337ec039040887d608c826595fbe56ca0 +Author: Elliot Lee +Date: Fri Dec 3 18:52:37 2004 +0000 + + sync + +commit 6d1ad8ea36efc07d71def0959ad97d2d73491a53 +Author: Elliot Lee +Date: Thu Dec 2 20:54:26 2004 +0000 + + sparcv8 support (#117302) + +commit d10e27e7b757991e6a1cbc62e0b1a772fb7f9ac8 +Author: Elliot Lee +Date: Mon Nov 15 15:23:30 2004 +0000 + + add _FORTIFY_SOURCE + +commit 84b567815c745a5f34e3bc3ecc917d7cd40d8c75 +Author: Adrian Havill +Date: Fri Oct 15 21:02:36 2004 +0000 + + add "-f" (--force) to gunzip and bunzip2 for corner cases so that rpmbuild + doesn't interactively ask to overwrite when it doesn't need to + +commit 7a4e10bb6560b90d44ae0a7ee43f419140a5aae9 +Author: Bill Nottingham +Date: Fri Oct 1 18:54:27 2004 +0000 + + don't filter symbol versioning + +commit 4b07b8dbc67bd2cfa73d5d5ca67e04398bf0cd69 +Author: Elliot Lee +Date: Mon Jun 28 19:48:43 2004 +0000 + + 8.0.31 + +commit 0f91dc03fc4d0ce3a5b5b672d25e40eb68787515 +Author: Elliot Lee +Date: Mon Jun 28 14:07:05 2004 +0000 + + add optflags for PPC 8260/8520 + +commit c9593fd884a918e831ac434479be88a5f7bed610 +Author: Elliot Lee +Date: Fri Jun 25 16:16:14 2004 +0000 + + fix typo + +commit fbb9bd1577195638ec67be49ec986c8d67b22dcd +Author: Elliot Lee +Date: Fri Jun 25 16:15:56 2004 +0000 + + oops + +commit 2c52d52eec5577c9ec1aaf8f372067120d8a96c5 +Author: Elliot Lee +Date: Fri Jun 25 16:02:37 2004 +0000 + + 8.0.29 + +commit 3e612b63b980f85179a05951af3693267ba974c3 +Author: Elliot Lee +Date: Fri Jun 25 16:01:38 2004 +0000 + + sync + +commit 92708fa5156c9ba4a084ad5ef709872ac78c00d9 +Author: Elliot Lee +Date: Fri Apr 23 14:23:32 2004 +0000 + + #117217 + +commit 2eb59b7156aea3058bdcbce7bf334cf1017dad43 +Author: Elliot Lee +Date: Mon Mar 1 17:29:43 2004 +0000 + + sync + +commit ecdfe2c6d31c7aefdd9f110d601e04af2e90f8f8 +Author: Elliot Lee +Date: Mon Nov 3 20:35:50 2003 +0000 + + fix 108049 + +commit 421fb7784f226ae86c53a19970dae5e8133506e5 +Author: Elliot Lee +Date: Wed Sep 17 12:41:38 2003 +0000 + + 8.0.28-1.1 + +commit ff150bb9f8902c9b3b418a9c49c59eb9493ad0c0 +Author: Elliot Lee +Date: Wed Sep 17 12:36:32 2003 +0000 + + 8.0.28 + +commit 4ccbbe76dcd137e924faa6b4b5668f29720e37fc +Author: Elliot Lee +Date: Tue Jul 15 13:44:02 2003 +0000 + + 8.0.27-1 + +commit a2894a5e9a3ee9cb1c7344b59b9aba6dee6b79df +Author: Elliot Lee +Date: Tue Jul 15 13:38:58 2003 +0000 + + 8.0.27-1 + +commit 9d388dbd199f0f73e514337708c947cb630a9295 +Author: Jens Petersen +Date: Mon Jul 7 02:32:13 2003 +0000 + + * Mon Jul 7 2003 Jens Petersen - 8.0.26-1 + - preserve the vendor field when VENDOR not set + - put VENDOR in the final i386-libc line, not the tentative one + +commit 7bf42f4c8de0b93f5ab7fc22fb841bb46bf7eb0c +Author: Jens Petersen +Date: Mon Jul 7 01:18:33 2003 +0000 + + * Mon Jul 07 2003 Jens Petersen - 8.0.25-1 + - update config.{guess,sub} to 2003-06-17 + - define VENDOR to be redhat only when /etc/redhat-release present + [suggested by jbj] + - put VENDOR in vendor field in our config.guess file for + ia64, ppc, ppc64, s390, s390x, x86_64 and elf32-i386 Linux + - drop the --host, --build, --target and --program-prefix configure options + from %%configure, since this causes far too many problems + +commit fb0d40d7ad1a3c5766ff57e015f02015669e4c86 +Author: Jens Petersen +Date: Fri May 2 10:05:02 2003 +0000 + + For Cambridge too. + +commit dec5bd1983641e999761a0110f83982b7023f852 +Author: Jens Petersen +Date: Fri May 2 10:00:46 2003 +0000 + + 8.0.24-2 + - force config.{guess,sub} executable by chmod in spec file. + +commit 0c7a682bd0fa5e7df86239fd690fd672db6c8737 +Author: Jens Petersen +Date: Fri May 2 09:51:49 2003 +0000 + + 8.0.24-1 + - Re-add config.{sub,guess} executable. + +commit b14b80a9807f93b0f053decc287b5cc710ce9f8d +Author: Jens Petersen +Date: Fri May 2 09:48:05 2003 +0000 + + Remove non-executable config.{sub,guess}. + +commit 7bd518af03088f8f2981561de0eced096b8f80ff +Author: Jens Petersen +Date: Fri May 2 09:41:17 2003 +0000 + + Up the release. + +commit 3f7f45e72adf246accf1dc403d62357f9a59dfc8 +Author: Jens Petersen +Date: Fri May 2 09:27:06 2003 +0000 + + 8.0.23-1 + - make config.{guess,sub} executable + +commit 0a7adcf3755a24897a74213a7bc87e99aa5ac1a2 +Author: Jens Petersen +Date: Thu May 1 12:27:40 2003 +0000 + + 8.0.22-2 for Taroon + +commit 1688b1245423162342c1faaba19d43b48332d681 +Author: Jens Petersen +Date: Thu May 1 08:19:29 2003 +0000 + + 8.0.22-1 + - apply s390 patch to config.sub + +commit 2a08d4631885aad8d715a58dd1bfd16e888e5c6e +Author: Jens Petersen +Date: Thu May 1 08:13:14 2003 +0000 + + - add config.guess and config.sub (2003-02-22) + - make %%configure use them + +commit 4410abdbbbe69200ca2260ec02d53b1ba746668d +Author: Elliot Lee +Date: Mon Mar 3 16:16:20 2003 +0000 + + Unset $DISPLAY in macros + +commit ae8ce229ab77d1783cc5809ec7d8f81fa6c2a069 +Author: Elliot Lee +Date: Mon Feb 24 18:39:29 2003 +0000 + + 8.0.21 + +commit e7eb34f0891695613ee90e6133f6684baa57443f +Author: Elliot Lee +Date: Thu Feb 13 16:33:31 2003 +0000 + + Reorganize rpmrc/macros to set cflags in a nicer manner. + +commit 47b9f849d4eaa77fff73444507bb07d09b3a9d8b +Author: Elliot Lee +Date: Wed Jan 22 18:30:56 2003 +0000 + + 8.0.19 + +commit 7d233e283eb7dfe405f01c6c75c9443cf76307ee +Author: Nalin Dahyabhai +Date: Mon Jan 20 20:06:50 2003 +0000 + + add brp-implant-ident-static, which requires mktemp + +commit fd6018eddb03564b16ae805c2b2524efbd2b964c +Author: Bill Nottingham +Date: Thu Jan 9 19:52:24 2003 +0000 + + happy new year + +commit 3397996dd936b6e09111e5c9a0e2de83b1f85f34 +Author: Bill Nottingham +Date: Thu Jan 9 19:52:00 2003 +0000 + + add brp-strip-static-archive + +commit 89a0b75d713d23fa66b9fee671418997d2520d8b +Author: Bill Nottingham +Date: Tue Dec 17 07:12:32 2002 +0000 + + make '-g' in optflags dependent on whether or not debug_package has a + value. This is Ugly(tm). + +commit 5fbe73ed9169cc7ea2a64d5b3c3d3b4152a7ae45 +Author: Elliot Lee +Date: Mon Dec 16 18:53:55 2002 +0000 + + 8.0.15-1 + +commit 1640cd5cac6e1308de8f303e95089053e7f5c9b5 +Author: Tim Powers +Date: Sat Dec 14 20:37:32 2002 +0000 + + more debug macro tweaks + +commit 28188548fc32289ab108d06b2d6f693da742d653 +Author: Tim Powers +Date: Sat Dec 14 18:01:21 2002 +0000 + + forgot the changelog + +commit 4707ac95be01a199d575544ad03a33d934b829a9 +Author: Tim Powers +Date: Sat Dec 14 17:57:23 2002 +0000 + + add internal dep generation macro, turn it on + +commit ff2bb8193467ec983ef3ad4a64fa535d69f51056 +Author: Bill Nottingham +Date: Fri Dec 13 23:04:56 2002 +0000 + + use internal dependency generator + +commit d4c201f55593bd7c9eb13c784e6205f4c400d619 +Author: Elliot Lee +Date: Fri Dec 13 17:20:16 2002 +0000 + + 8.0.12-1 + +commit d18a947668e119ae692467d907098969d7ab054b +Author: Alexander Larsson +Date: Fri Dec 13 17:13:18 2002 +0000 + + Make a temporary copy of the debug_package macro so that we get the noarch fix + +commit cec7d078f8d1d1458ccf7a6f67b99828ea2652a8 +Author: Elliot Lee +Date: Wed Dec 11 18:05:00 2002 +0000 + + someday I will get it right + +commit 09f5ffd107613802d6fb00ac972be72ec9bb22e6 +Author: Elliot Lee +Date: Wed Dec 11 15:39:47 2002 +0000 + + add -g + +commit e44c237bfbab96439a6c527fa8cd0d108caaadf2 +Author: Elliot Lee +Date: Wed Dec 11 15:05:08 2002 +0000 + + 8.0.9 + +commit 555b69e7a21f7a25b8a45a5ceafd59f4aec1a207 +Author: Bill Nottingham +Date: Wed Dec 4 04:57:53 2002 +0000 + + i like make archive :) + +commit 47209decbed507e488d30fb871a356eacdb8899f +Author: Bill Nottingham +Date: Wed Dec 4 04:55:22 2002 +0000 + + nuke -g + +commit c643f846cea472bad5172421417e905f9c4b9ade +Author: Elliot Lee +Date: Mon Nov 25 20:44:00 2002 +0000 + + 8.0.7-2 + +commit 3f184f50a8264627bd45d76080dac5107aaf431c +Author: Elliot Lee +Date: Mon Nov 25 19:27:56 2002 +0000 + + add -g + +commit 389ef3b0722786331a2127c19ee74ba9c61ade1a +Author: Elliot Lee +Date: Fri Nov 22 18:57:51 2002 +0000 + + 8.0.7 + +commit dce3663fe68413c7fd23b4b0878a9b98bca7e828 +Author: Elliot Lee +Date: Fri Nov 22 18:56:01 2002 +0000 + + enable debug packages, etc. + +commit 53cca9f509d822fb9208273c86a2f563878ce5d6 +Author: Elliot Lee +Date: Thu Nov 21 17:22:31 2002 +0000 + + More reasons why rpmrc's "macrofiles" directive is broken. + +commit 1de7d81cf05827bfc39d31de238cddc962ffff74 +Author: Elliot Lee +Date: Thu Nov 21 16:54:33 2002 +0000 + + Pass __strip and __objdump macros + +commit 3b777d0999f8008f19f2b84324b895f7e5749d67 +Author: Elliot Lee +Date: Thu Nov 21 15:16:38 2002 +0000 + + 8.0.5 + +commit 27ac1446b099a61a4ae1a28069a8aef9163a61ce +Author: Alexander Larsson +Date: Wed Nov 20 16:55:36 2002 +0000 + + Make brp-strip* not strip debug objects + Add a _enable_debug_packages macro (commented out) + +commit f3e01161c3636836367c73dbb5e1594175a738fe +Author: Elliot Lee +Date: Thu Nov 14 12:48:21 2002 +0000 + + Fix from bug #77849. + +commit d4970a5d33d3edac755cb702ac7d2670eb551408 +Author: Elliot Lee +Date: Wed Nov 6 16:32:52 2002 +0000 + + 8.0.4 + +commit fa316006e8ce85e74f54c6bfbbf6ef70e61f3649 +Author: Elliot Lee +Date: Thu Oct 31 16:23:46 2002 +0000 + + remove tracking dependency + +commit 164e1163e427b2a731af2848217b04064b97b674 +Author: Elliot Lee +Date: Mon Oct 21 15:28:51 2002 +0000 + + find-lang fix(?) for symlinks + +commit 0a68ef9360bc52f57cabbd90bc5deb8fd502b37e +Author: Phil Knirsch +Date: Wed Oct 16 18:07:49 2002 +0000 + + - Added fix for outdated config.[sub|guess] files in %configure section. + +commit d5044b55bfe6cc43c15803ee3f24348f4f788acc +Author: Elliot Lee +Date: Wed Oct 16 17:19:55 2002 +0000 + + 8.0.3 + +commit 7f05ca8c77bbc56ee514b430f007f977ad18bdcc +Author: Elliot Lee +Date: Fri Oct 4 13:45:14 2002 +0000 + + Be stricter now. + +commit be06bd913d9620a0cd92326d73bbaae4b35b2fc6 +Author: Jeremy Katz +Date: Thu Oct 3 16:32:45 2002 +0000 + + bump to 8.0.2, add a changelog entry + +commit 8a919b8bb95886511ca57419d99e440a26422f27 +Author: Jeremy Katz +Date: Thu Oct 3 16:31:51 2002 +0000 + + We shouldn't be redefining everything in the redhat-rpm-config macros + file, because that will start overriding things like %{_lib} -- probably + more could have been snipped, but the remaining bits are at least + moderately reasonable to make sure are defined according to "our policy" + +commit 61fb9e24ccaab07764010c1ab67e04ee5282b02c +Author: Alexander Larsson +Date: Mon Sep 16 16:22:01 2002 +0000 + + Add debug package support to %__spec_install_post + +commit bfb314aef89d7e9a33b423dc2d1dddca7cb9c472 +Author: Bill Nottingham +Date: Wed Sep 4 03:12:16 2002 +0000 + + bump version + +commit 122edab4162312fa15199619e1087e91ead2bfea +Author: Elliot Lee +Date: Wed Aug 28 18:45:29 2002 +0000 + + 7.3.94 + +commit 3031bc234c0257a9c70abbc7977a51d6ed444d0a +Author: Elliot Lee +Date: Wed Jul 31 18:57:20 2002 +0000 + + 7.3.93 + +commit f0352fc0402f267c8ea880a0cb3c115f669848a3 +Author: Elliot Lee +Date: Wed Jul 31 18:56:20 2002 +0000 + + Part two of new macros + +commit 00cbca969b970ded6d3d0a7061b6cd5de1a08de6 +Author: Elliot Lee +Date: Wed Jul 31 17:05:22 2002 +0000 + + Add comment about missing docs flag. + +commit 7f634c575d0613ad1ea113e57deaa8ef931fd9dd +Author: Karsten Hopp +Date: Mon Jul 15 13:45:55 2002 +0000 + + typo + +commit 8617b2fe71e17516c25cdc026c920e38ea738bca +Author: Elliot Lee +Date: Thu Jul 11 18:48:52 2002 +0000 + + find-requires fix from 67325 + +commit 38aa58396700a1bbc85751f62f208a926588d9d2 +Author: Elliot Lee +Date: Thu Jul 11 18:46:14 2002 +0000 + + find-lang.sh fix from 67368 + +commit 3faabb2c8f5daf7815c8959383da39418d30db9b +Author: Elliot Lee +Date: Thu Jul 11 18:43:40 2002 +0000 + + fix from 67368 + +commit 3827110e0a259e79ee42e61454f4af679f04be44 +Author: Elliot Lee +Date: Thu Jul 11 17:07:42 2002 +0000 + + Add /etc/rpm/macros back to make #67951 go away + +commit 22b27c88b968f8271110c98e0b8d1d4198a06002 +Author: Jens Petersen +Date: Fri Jun 28 06:19:26 2002 +0000 + + tidy rpm changelog entry + +commit cb63b82a2d671a5b4f4224c5156a343906d53a9f +Author: Jens Petersen +Date: Fri Jun 28 05:25:23 2002 +0000 + + Add %{?_gnu} to _target_platform. + Use --host, --build, --target and --program-prefix in %configure. + 7.3.92-4 + +commit f6a0040f2b3ed22b5d697359b04ce7e40f071568 +Author: Elliot Lee +Date: Wed Jun 26 14:24:45 2002 +0000 + + ~/.rpmmacros + +commit 3687e63a720668cb7f0d103f3c51374426ef1465 +Author: Elliot Lee +Date: Fri Jun 21 18:17:17 2002 +0000 + + sync + +commit d5db7f5dedf550d1fc672c1d9e8977ca3e5d830b +Author: Elliot Lee +Date: Fri Jun 21 18:13:56 2002 +0000 + + 7.3.92-2 + +commit 3ee6bad5b99ab12d786901af2a32efcf46e3a456 +Author: Elliot Lee +Date: Thu Jun 20 20:56:07 2002 +0000 + + find-lang fixes + +commit 8c076a37c8c2481ea2ff46a86d07d27b54cb0168 +Author: Elliot Lee +Date: Thu Jun 20 20:56:07 2002 +0000 + + find-lang fixes + +commit 668485e883b9e951c5bdf77f76634eae6cf02059 +Author: Elliot Lee +Date: Wed Jun 12 21:04:24 2002 +0000 + + Locale hack. + +commit 99968383d11f9b8dece46df2b5f3ea549ea2c6e0 +Author: Elliot Lee +Date: Wed Jun 12 13:26:24 2002 +0000 + + 7.3.91 + +commit f494dd7f794031a799d5c56eedbc2b98f2598e53 +Author: Elliot Lee +Date: Wed Jun 12 13:19:22 2002 +0000 + + 7.3.91 + +commit 72cfc641ce0b8da9d6e8503b37826b7350e25c34 +Author: Elliot Lee +Date: Wed Jun 12 13:18:39 2002 +0000 + + sync + +commit 03bb2914eabf0d4ae7fcd59da272db326969288a +Author: Elliot Lee +Date: Wed Jun 12 12:59:50 2002 +0000 + + Initial revision diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8b94b5d --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +NAME=redhat-rpm-config +VERSION=9.1.0 + +CVSTAG = REDHAT_RPM_CONFIG_$(subst .,_,$(VERSION)) + +all: + +clean: + rm -f *~ + +install: + mkdir -p $(DESTDIR)/usr/lib/rpm/redhat + cp -pr * $(DESTDIR)/usr/lib/rpm/redhat/ + rm -f $(DESTDIR)/usr/lib/rpm/redhat/Makefile + +tag-archive: + @git tag -a $(CVSTAG) -m "$(NAME)-$(VERSION) release" + +create-archive: + @git archive --format=tar --prefix=$(NAME)-$(VERSION)/ HEAD | tar xf - + @git log > $(NAME)-$(VERSION)/ChangeLog + @tar cjf $(NAME)-$(VERSION).tar.bz2 $(NAME)-$(VERSION) + @rm -rf $(NAME)-$(VERSION) + @echo "Created $(NAME)-$(VERSION).tar.bz2" + +archive: tag-archive create-archive diff --git a/brp-compress b/brp-compress new file mode 100755 index 0000000..3f76fe5 --- /dev/null +++ b/brp-compress @@ -0,0 +1,56 @@ +#!/bin/sh + +# If using normal root, avoid changing anything. +if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then + exit 0 +fi + +cd $RPM_BUILD_ROOT + +# Compress man pages +COMPRESS="gzip -9 -n" +COMPRESS_EXT=.gz + +for d in ./usr/man/man* ./usr/man/*/man* ./usr/info \ + ./usr/share/man/man* ./usr/share/man/*/man* ./usr/share/info \ + ./usr/kerberos/man ./usr/X11R6/man/man* ./usr/lib/perl5/man/man* \ + ./usr/share/doc/*/man/man* ./usr/lib/*/man/man* +do + [ -d $d ] || continue + for f in `find $d -type f` + do + [ -f "$f" ] || continue + [ "`basename $f`" = "dir" ] && continue + + case "$f" in + *.Z) gunzip -f $f; b=`echo $f | sed -e 's/\.Z$//'`;; + *.gz) gunzip -f $f; b=`echo $f | sed -e 's/\.gz$//'`;; + *.bz2) bunzip2 -f $f; b=`echo $f | sed -e 's/\.bz2$//'`;; + *) b=$f;; + esac + + $COMPRESS $b /dev/null || { + inode=`ls -i $b | awk '{ print $1 }'` + others=`find $d -type f -inum $inode` + if [ -n "$others" ]; then + for afile in $others ; do + [ "$afile" != "$b" ] && rm -f $afile + done + $COMPRESS -f $b + for afile in $others ; do + [ "$afile" != "$b" ] && ln $b$COMPRESS_EXT $afile$COMPRESS_EXT + done + else + $COMPRESS -f $b + fi + } + done + + for f in `find $d -type l` + do + l=`ls -l $f | sed -e 's/.* -> //' -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//'` + rm -f $f + b=`echo $f | sed -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//'` + ln -sf $l$COMPRESS_EXT $b$COMPRESS_EXT + done +done diff --git a/brp-implant-ident-static b/brp-implant-ident-static new file mode 100755 index 0000000..4a26cea --- /dev/null +++ b/brp-implant-ident-static @@ -0,0 +1,34 @@ +#!/bin/bash + +# If using normal root, avoid changing anything. +if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then + exit 0 +fi + +tempdir=`mktemp -d /tmp/implant-ident-XXXXXX` +if test -z "$tempdir" ; then + exit 1 +fi + +cleanup() { + rm -f $tempdir/* + rmdir $tempdir +} +trap cleanup 0 1 2 3 4 5 6 7 8 9 11 13 14 15 + +for library in `find $RPM_BUILD_ROOT -type f -exec file \{\} \; | grep 'current ar archive' | sed 's,:.*,,g' ` ; do + pushd $tempdir > /dev/null + if test -n "$RPM_BUILD_ROOT" ; then + cleanedlibrary=`echo "$library" | sed s,"$RPM_BUILD_ROOT",,g` + else + cleanedlibrary="$library" + fi + ar x "$library" + for object in *.o ; do + echo '$RPM: '${RPM_PACKAGE_NAME:-UNKNOWN_NAME}-${RPM_PACKAGE_VERSION:-UNKNOWN_VERSION}-${RPM_PACKAGE_RELEASE:-UNKNOWN_RELEASE}:"$cleanedlibrary":"$object"' $' > __x_rpm_ident_string.txt + objcopy --add-section .rodata=__x_rpm_ident_string.txt "$object" + ar r "$library" "$object" + done + rm -f *.o + popd > /dev/null +done diff --git a/brp-java-repack-jars b/brp-java-repack-jars new file mode 100755 index 0000000..ec2b72a --- /dev/null +++ b/brp-java-repack-jars @@ -0,0 +1,99 @@ +#!/bin/sh + +# If using normal root, avoid changing anything. +if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then + exit 0 +fi + +# If zip is not installed, we can't repack the jars. +if [ ! -x /usr/bin/zip ]; then + exit 0 +fi +if [ ! -x /usr/bin/unzip ]; then + exit 0 +fi + +JARS=`find $RPM_BUILD_ROOT -type f -name \*.jar -not -size 0` +if [ ! -z "$JARS" ]; then + + # make $RPM_BUILD_ROOT/tmp if it doesn't exist + rmtmp=0 + if [ ! -x "$RPM_BUILD_ROOT/tmp" ]; then + mkdir -p $RPM_BUILD_ROOT/tmp + rmtmp=1 + fi + + # unpack every jar, set the date of the files and directories and + # repack the jar + for j in $JARS ; do + JARNAME=`basename $j` + JTMPDIR=`mktemp -d -p $RPM_BUILD_ROOT/tmp $JARNAME.tmpdir.XXXXXXXXXX` || exit 1 + JARDIR=`mktemp -d -p $RPM_BUILD_ROOT/tmp $JARNAME.jardir.XXXXXXXXXX` || exit 1 + TIMEREF=`mktemp -p $RPM_BUILD_ROOT/tmp $JARNAME.timeref.XXXXXXXXXX` || exit 1 + + pushd $JTMPDIR > /dev/null + /usr/bin/unzip -qq -o $j + find -type d -exec chmod a+rx {} \; + find -type f -exec chmod a+r {} \; + rm -f $j + + # Create the directories first. + find -type d | LC_ALL=C sort | while read d; do + mkdir -p "$JARDIR/$d" + done + + # Get the modtime from the newest ChangeLog. If the project + # doesn't have a ChangeLog, Jan 1, 1970 will be used. + DATE="1970-01-01 UTC" + + if [ -z $_PACKAGE_BUILD_DIR ]; then + _PACKAGE_BUILD_DIR=$RPM_BUILD_DIR/$RPM_PACKAGE_NAME-$RPM_PACKAGE_VERSION + fi + + if [ -d $_PACKAGE_BUILD_DIR ]; then + CHANGELOGS=`find $_PACKAGE_BUILD_DIR -type f -name ChangeLog` + if [ ! -z "$CHANGELOGS" ]; then + for c in $CHANGELOGS; do + TMPDATE=`stat -c %y $c | cut -d " " -f 1-2` + if [ `date --date="$TMPDATE" +%s` -gt `date --date="$DATE" +%s` ]; then + DATE="$TMPDATE" + fi + done + fi + fi + + # move the contents over to the a new directory in order and set + # the times. + find -type f | LC_ALL=C sort | while read f; do + cp "$f" "$JARDIR/$f" + touch --date="$DATE" "$JARDIR/$f" + done + popd > /dev/null + + # Set the times of the directories. + find "$JARDIR" -type d | while read d; do + touch --date="$DATE" "$d" + done + + # make the jar + pushd $JARDIR > /dev/null + + if [ -n "`find -not -name '.'`" ]; then + find * -not -name '.' | LC_ALL=C sort | /usr/bin/zip -q -X -9 $j -@ + else + # Put the empty jar back + touch $j + fi + popd > /dev/null + + # Cleanup. + rm -rf $JTMPDIR + rm -rf $JARDIR + rm -f $TIMEREF + done + + # remove $RPM_BUILD_ROOT/tmp if we created it + if [ $rmtmp -eq 1 ]; then + rm -rf $RPM_BUILD_ROOT/tmp + fi +fi diff --git a/brp-python-hardlink b/brp-python-hardlink new file mode 100755 index 0000000..a937529 --- /dev/null +++ b/brp-python-hardlink @@ -0,0 +1,19 @@ +#!/bin/sh + +# If using normal root, avoid changing anything. +if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then + exit 0 +fi + +# Hardlink identical *.pyc and *.pyo, originally from PLD's rpm-build-macros +# Modified to use sha1sum instead of cmp to avoid a diffutils dependency. +find "$RPM_BUILD_ROOT" -type f -name "*.pyc" | while read pyc ; do + pyo="$(echo $pyc | sed -e 's/.pyc$/.pyo/')" + if [ -f "$pyo" ] ; then + csha="$(sha1sum -b $pyc | cut -d' ' -f 1)" && \ + osha="$(sha1sum -b $pyo | cut -d' ' -f 1)" && \ + if [ "$csha" = "$osha" ] ; then + ln -f "$pyc" "$pyo" + fi + fi +done diff --git a/brp-strip b/brp-strip new file mode 100755 index 0000000..4882f5f --- /dev/null +++ b/brp-strip @@ -0,0 +1,14 @@ +#!/bin/sh +# If using normal root, avoid changing anything. +if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then + exit 0 +fi +[ -z "$STRIP" -a -n "$1" ] && STRIP="$1" +[ -z "$STRIP" ] && STRIP=strip +# Strip ELF binaries +for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \ + grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \ + grep -v ' shared object,' | \ + sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do + $STRIP -g "$f" || : +done diff --git a/brp-strip-comment-note b/brp-strip-comment-note new file mode 100755 index 0000000..0b63efe --- /dev/null +++ b/brp-strip-comment-note @@ -0,0 +1,23 @@ +#!/bin/sh +# If using normal root, avoid changing anything. +if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then + exit 0 +fi + +[ -z "$STRIP" -a -n "$1" ] && STRIP="$1" +[ -z "$OBJDUMP" -a -n "$2" ] && OBJDUMP="$2" +[ -z "$STRIP" ] && STRIP=strip +[ -z "$OBJDUMP" ] && OBJDUMP=objdump + +# Strip .comment and .note sections (the latter only if it is not allocated) +# for already stripped elf files in the build root +for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \ + grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \ + sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped/\1/p'`; do + note="-R .note" + if $OBJDUMP -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \ + grep ALLOC >/dev/null; then + note= + fi + $STRIP -R .comment $note "$f" || : +done diff --git a/brp-strip-shared b/brp-strip-shared new file mode 100755 index 0000000..9b78d5e --- /dev/null +++ b/brp-strip-shared @@ -0,0 +1,20 @@ +#!/bin/sh +# Conectiva brp - strip shared libraries. Based on Red Hat's brp-strip. +# Thu Apr 20 - Guilherme Manika +# Created file + +if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then + exit 0 +fi + +[ -z "$STRIP" -a -n "$1" ] && STRIP="$1" +[ -z "$STRIP" ] && STRIP=strip +# Strip ELF shared objects +# Please note we don't restrict our search to executable files because +# our libraries are not (should not be, at least) +x. +for f in `find $RPM_BUILD_ROOT -type f -a -exec file {} \; | \ + grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \ + grep ' shared object,' | \ + sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do + $STRIP --strip-unneeded "$f" +done diff --git a/brp-strip-static-archive b/brp-strip-static-archive new file mode 100755 index 0000000..150e700 --- /dev/null +++ b/brp-strip-static-archive @@ -0,0 +1,16 @@ +#!/bin/sh + +if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then + exit 0 +fi + +[ -z "$STRIP" -a -n "$1" ] && STRIP="$1" +[ -z "$STRIP" ] && STRIP=strip + +# Strip static libraries. +for f in `find $RPM_BUILD_ROOT -name \*.a -a -exec file {} \; | \ + grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \ + grep 'current ar archive' | \ + sed -n -e 's/^\(.*\):[ ]*current ar archive/\1/p'`; do + $STRIP -g "$f" +done diff --git a/dist.sh b/dist.sh new file mode 100755 index 0000000..db64291 --- /dev/null +++ b/dist.sh @@ -0,0 +1,83 @@ +#!/bin/bash +# dist.sh +# Author: Tom "spot" Callaway +# License: GPL +# This is a script to output the value for the %{dist} +# tag. The dist tag takes the following format: .$type$num +# Where $type is one of: el, fc, rh +# (for RHEL, Fedora Core, and RHL, respectively) +# And $num is the version number of the distribution. +# NOTE: We can't detect Rawhide or Fedora Test builds properly. +# If we successfully detect the version number, we output the +# dist tag. Otherwise, we exit with no output. + +RELEASEFILE=/etc/redhat-release + +function check_num { + MAINVER=`cut -d "(" -f 1 < $RELEASEFILE | \ + sed -e "s/[^0-9.]//g" -e "s/$//g" | cut -d "." -f 1` + + echo $MAINVER | grep -q '[0-9]' && echo $MAINVER +} + +function check_rhl { + grep -q "Red Hat Linux" $RELEASEFILE && ! grep -q "Advanced" $RELEASEFILE && echo $DISTNUM +} + +function check_rhel { + egrep -q "(Enterprise|Advanced)" $RELEASEFILE && echo $DISTNUM +} + +function check_fedora { + grep -q Fedora $RELEASEFILE && echo $DISTNUM +} + +PELRELFILE=/etc/powerel-release + +function check_ver { + MAINVER=`cut -d "(" -f 1 < $PELRELFILE | \ + sed -e "s/[^0-9.]//g" -e "s/$//g" | cut -d "." -f 1` + echo $PELVER | grep -q '[0-9]' && echo $PELVER +} + +function check_pel { + grep -q "PowerEL" $PELRELFILE && echo $PELNUM +} + +DISTNUM=`check_num` +DISTFC=`check_fedora` +DISTRHL=`check_rhl` +DISTRHEL=`check_rhel` +PELNUM=`check_ver` +DISTPEL=`check_pel` +if [ -n "$DISTNUM" ]; then + if [ -n "$DISTFC" ]; then + DISTTYPE=fc + elif [ -n "$DISTRHEL" ]; then + DISTTYPE=el + elif [ -n "$DISTRHL" ]; then + DISTTYPE=rhl + elif [ -n "$DISTPEL" ]; then + DISTTYPE=pel + DISTNUM=$DISTPEL + fi +fi +[ -n "$DISTTYPE" -a -n "$DISTNUM" ] && DISTTAG=".${DISTTYPE}${DISTNUM}" + +case "$1" in + --el) echo -n "$DISTRHEL" ;; + --fc) echo -n "$DISTFC" ;; + --rhl) echo -n "$DISTRHL" ;; + --distnum) echo -n "$DISTNUM" ;; + --disttype) echo -n "$DISTTYPE" ;; + --help) + printf "Usage: $0 [OPTIONS]\n" + printf " Default mode is --dist. Possible options:\n" + printf " --el\t\tfor RHEL version (if RHEL)\n" + printf " --fc\t\tfor Fedora version (if Fedora)\n" + printf " --rhl\t\tfor RHL version (if RHL)\n" + printf " --dist\t\tfor distribution tag\n" + printf " --distnum\tfor distribution number (major)\n" + printf " --disttype\tfor distribution type\n" ;; + *) echo -n "$DISTTAG" ;; +esac diff --git a/find-provides b/find-provides new file mode 100755 index 0000000..de4dfaa --- /dev/null +++ b/find-provides @@ -0,0 +1,112 @@ +#!/bin/bash + +# This script reads filenames from STDIN and outputs any relevant provides +# information that needs to be included in the package. + +if [ "$1" ] +then + package_name="$1" +fi + +[ -z "$OBJDUMP" ] && OBJDUMP=objdump + +filelist=`sed "s/['\"]/\\\&/g"` + +solist=$(echo $filelist | grep "\\.so" | grep -v "^/lib/ld.so" | \ + xargs file -L 2>/dev/null | grep "ELF.*shared object" | cut -d: -f1) +pythonlist= +tcllist= + +# +# --- Alpha does not mark 64bit dependencies +case `uname -m` in + alpha*) mark64="" ;; + *) mark64="()(64bit)" ;; +esac + +# +# --- Library sonames and weak symbol versions (from glibc). +for f in $solist; do + soname=$(objdump -p $f | awk '/SONAME/ {print $2}') + + lib64=`if file -L $f 2>/dev/null | \ + grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi` + if [ "$soname" != "" ]; then + if [ ! -L $f ]; then + echo $soname$lib64 + objdump -p $f | awk ' + BEGIN { START=0 ; } + /Version definitions:/ { START=1; } + /^[0-9]/ && (START==1) { print $4; } + /^$/ { START=0; } + ' | \ + grep -v $soname | \ + while read symbol ; do + echo "$soname($symbol)`echo $lib64 | sed 's/()//'`" + done + fi + else + echo ${f##*/}$lib64 + fi +done | sort -u + +# +# --- Perl modules. +[ -x /usr/lib/rpm/perl.prov ] && + echo $filelist | tr '[:blank:]' \\n | grep '\.pm$' | /usr/lib/rpm/perl.prov | sort -u + +# +# --- Python modules. +[ -x /usr/lib/rpm/redhat/python.prov -a -n "$pythonlist" ] && + echo $pythonlist | tr '[:blank:]' \\n | /usr/lib/rpm/redhat/python.prov | sort -u + +# +# --- Tcl modules. +[ -x /usr/lib/rpm/redhat/tcl.prov -a -n "$tcllist" ] && + echo $tcllist | tr '[:blank:]' \\n | /usr/lib/rpm/redhat/tcl.prov | sort -u + +# +# --- libtool +[ -x /usr/lib/rpm/redhat/find-provides.libtool ] && + echo $filelist | tr '[:blank:]' \\n | /usr/lib/rpm/redhat/find-provides.libtool | sort -u + +# +# --- any other extra find-provides scripts +for i in /usr/lib/rpm/redhat/find-provides.d/*.prov +do + [ -x $i ] && + (echo $filelist | tr '[:blank:]' \\n | $i | sort -u) +done + +# +# --- pkgconfig +[ -x /usr/lib/rpm/redhat/find-provides.pkgconfig ] && + echo $filelist | tr '[:blank:]' \\n | /usr/lib/rpm/redhat/find-provides.pkgconfig | sort -u + +# +# --- Kernel module imported symbols +# +# Since we don't (yet) get passed the name of the package being built, we +# cheat a little here by looking first for a kernel, then for a kmod. +# + +is_kmod=1 +for f in $filelist; do + if [ $(echo "$f" | sed -r -ne 's:^.*/lib/modules/(.*)/(.*).ko$:\2:p') ] + then + is_kernel=1; + fi + if [ $(echo "$f" | sed -r -ne 's:^.*/boot/(.*):\1:p') ] + then + unset is_kmod; + fi +done +if [ ! "$is_kernel" ] || [ "$package_name" == "kernel" ] +then + unset is_kmod +fi + +[ -x /usr/lib/rpm/redhat/find-provides.ksyms ] && [ "$is_kmod" ] && + printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/redhat/find-provides.ksyms + +exit 0 diff --git a/find-provides.d/firmware.prov b/find-provides.d/firmware.prov new file mode 100644 index 0000000..3614369 --- /dev/null +++ b/find-provides.d/firmware.prov @@ -0,0 +1,14 @@ +#!/bin/sh +# +# firmware.prov - Automatically extract any and all firmware dependencies from +# kernel object (.ko) files and add to RPM deps. + +IFS=$'\n' + +for module in $(grep -E '/lib/modules/.+\.ko$') $*; +do + for firmware in `/sbin/modinfo -F firmware $module`; + do + echo "firmware($firmware)" + done +done diff --git a/find-provides.d/modalias.prov b/find-provides.d/modalias.prov new file mode 100644 index 0000000..e6e4bd6 --- /dev/null +++ b/find-provides.d/modalias.prov @@ -0,0 +1,76 @@ +#! /bin/sh + +# heavily based upon find-suggests.ksyms by Andreas Gruenbacher . +# with modifications by Michael Brown +# +# -- added module versioning info to modalias() symbols +# -- removed code which inspects spec files. + +IFS=$'\n' + +# +# Initially, dont generate modalias() lines for kernel package. This needs +# additional discussion. Would like to eventually add them for +# completeness, so that we can determine when drivers are folded into +# mainline kernel. +# +case "$1" in +kernel-module-*) ;; # Fedora kernel module package names start with + # kernel-module. +kernel*) is_kernel_package=1 ;; +esac + +if ! [ -z "$is_kernel_package" ]; then + cat > /dev/null + exit 0 +fi + +print_modaliases() { + declare class=$1 variants=$2 pos=$3 + if [ -n "$variants" ]; then + echo "${class:0:pos}[$variants]${class:pos+1}" + else + [ -z "$class" ] || echo "$class" + fi +} + +combine_modaliases() { + declare tag class variants pos n + read class + while read tag; do + for ((n=0; n<${#class}; n++)); do + if [ "*" != "${class:n:1}" -a \ + "${class:0:n}" = "${tag:0:n}" -a \ + "${class:n+1}" = "${tag:n+1}" ] && + ( [ -z "$pos" ] || [ $n = $pos ] ); then + variants="${variants:-${class:n:1}}${tag:n:1}" + pos=$n + break + fi + done + if [ $n -eq ${#class} ]; then + print_modaliases "$class" "$variants" "$pos" + variants= + pos= + class=$tag + fi + done + print_modaliases "$class" "$variants" "$pos" +} + +for module in $(grep -E '/lib/modules/.+\.ko$') $*; do + # | head -n1 because some modules have *two* version tags. *cough*b44*cough* + modver=$(/sbin/modinfo -F version "$module"| head -n1) + modver=${modver// /_} + + # only add version tag if it has a version + if [ -n "$modver" ]; then + /sbin/modinfo -F alias "$module" \ + | sed -nre "s,(.+),modalias(\\1) = $modver,p" + else + /sbin/modinfo -F alias "$module" \ + | sed -nre "s,(.+),modalias(\\1),p" + fi +done \ +| sort -u \ +| combine_modaliases diff --git a/find-provides.ksyms b/find-provides.ksyms new file mode 100755 index 0000000..4616710 --- /dev/null +++ b/find-provides.ksyms @@ -0,0 +1,9 @@ +#! /bin/sh + +IFS=$'\n' + +for module in $(grep -E '/lib/modules/.+\.ko$'); do + nm $module \ + | sed -r -ne 's:^0*([0-9a-f]+) A __crc_(.+):ksym(\2) = \1:p' +done \ +| sort -u diff --git a/find-provides.libtool b/find-provides.libtool new file mode 100755 index 0000000..042ab29 --- /dev/null +++ b/find-provides.libtool @@ -0,0 +1,10 @@ +#!/bin/sh +while read possible ; do + case "$possible" in + *.la) + if grep -iq '^# Generated by ltmain.sh' "$possible" 2> /dev/null ; then + echo "libtool($possible)" + fi + ;; + esac +done diff --git a/find-provides.pkgconfig b/find-provides.pkgconfig new file mode 100755 index 0000000..389bef7 --- /dev/null +++ b/find-provides.pkgconfig @@ -0,0 +1,22 @@ +#!/bin/bash +pkgconfig=${1:-/usr/bin/pkg-config} +test -x $pkgconfig || exit 0 +while read filename ; do +case "${filename}" in +*.pc) + # Assume that this file doesn't contain useful information. + needs_pkgconfig=false + # Query the dependencies of the package. + $pkgconfig --print-provides "$filename" 2> /dev/null | while read n r v ; do + # We have a dependency. Make a note that we need the pkgconfig + # tool for this package. + echo "pkgconfig($n)" "$r" "$v" + needs_pkgconfig=true + done + # The dependency on the pkgconfig package itself. + if $needs_pkgconfig ; then + echo pkgconfig + fi + ;; +esac +done diff --git a/find-requires b/find-requires new file mode 100755 index 0000000..fa5ab95 --- /dev/null +++ b/find-requires @@ -0,0 +1,160 @@ +#!/bin/bash + +# +# Auto-generate requirements for executables (both ELF and a.out) and library +# sonames, script interpreters, and perl modules. +# + +ulimit -c 0 + +# +# --- Set needed to 0 for traditional find-requires behavior. +needed=1 +if [ X"$1" = Xldd ]; then + needed=0 +elif [ X"$1" = Xobjdump ]; then + needed=1 +fi +[ -z "$OBJDUMP" ] && OBJDUMP=objdump + +# +# --- Grab the file manifest and classify files. +#filelist=`sed "s/['\"]/\\\&/g"` +filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"` +exelist=`echo $filelist | xargs -r file | egrep -v ":.* (commands|script) " | \ + grep ":.*executable" | cut -d: -f1` +scriptlist=`echo $filelist | xargs -r file | \ + egrep ":.* (commands|script) " | cut -d: -f1` +liblist=`echo $filelist | xargs -r file | \ + grep ":.*shared object" | cut -d : -f1` + +interplist= +perllist= +pythonlist= +tcllist= + +# +# --- Alpha does not mark 64bit dependencies +case `uname -m` in + alpha*) mark64="" ;; + *) mark64="()(64bit)" ;; +esac + +if [ "$needed" -eq 0 ]; then +# +# --- Executable dependency sonames. + for f in $exelist; do + [ -r $f -a -x $f ] || continue + lib64=`if file -L $f 2>/dev/null | \ + grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi` + ldd $f | awk '/=>/ { + if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /libredhat-kernel.so/) { + gsub(/'\''"/,"\\&",$1); + printf "%s'$lib64'\n", $1 + } + }' + done | xargs -r -n 1 basename | sort -u + +# +# --- Library dependency sonames. + for f in $liblist; do + [ -r $f ] || continue + lib64=`if file -L $f 2>/dev/null | \ + grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi` + ldd $f | awk '/=>/ { + if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /libredhat-kernel.so/) { + gsub(/'\''"/,"\\&",$1); + printf "%s'$lib64'\n", $1 + } + }' + done | xargs -r -n 1 basename | sort -u +fi + +# +# --- Script interpreters. +for f in $scriptlist; do + [ -r $f -a -x $f ] || continue + interp=`head -n 1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1` + interplist="$interplist $interp" + case $interp in + */perl) perllist="$perllist $f" ;; + esac +done +[ -n "$interplist" ] && { echo "$interplist" | tr '[:blank:]' \\n | sort -u ; } + +# +# --- Add perl module files to perllist. +for f in $filelist; do + [ -r $f -a "${f%.pm}" != "${f}" ] && perllist="$perllist $f" +done + +# +# --- Weak symbol versions (from glibc). +[ -n "$mark64" ] && mark64="(64bit)" +for f in $liblist $exelist ; do + [ -r $f ] || continue + lib64=`if file -L $f 2>/dev/null | \ + grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi` + $OBJDUMP -p $f | awk 'BEGIN { START=0; LIBNAME=""; needed='$needed'; } + /^$/ { START=0; } + /^Dynamic Section:$/ { START=1; } + (START==1) && /NEEDED/ { + if (needed) { + if ("'$lib64'" != "") { + sub(/$/, "()'$lib64'", $2) ; + } + print $2 ; + } + } + /^Version References:$/ { START=2; } + (START==2) && /required from/ { + sub(/:/, "", $3); + LIBNAME=$3; + } + (START==2) && (LIBNAME!="") && ($4!="") { + print LIBNAME "(" $4 ")'$lib64'"; + } + /^[A-Za-z]/ { START=3; } + ' +done | sort -u + +# +# --- Perl modules. +[ -x /usr/lib/rpm/perl.req -a -n "$perllist" ] && \ + echo $perllist | tr '[:blank:]' \\n | /usr/lib/rpm/perl.req | sort -u + +# +# --- Python modules. +[ -x /usr/lib/rpm/redhat/python.req -a -n "$pythonlist" ] && \ + echo $pythonlist | tr '[:blank:]' \\n | /usr/lib/rpm/redhat/python.req | sort -u + +# +# --- Tcl modules. +[ -x /usr/lib/rpm/redhat/tcl.req -a -n "$tcllist" ] && \ + echo $tcllist | tr '[:blank:]' \\n | /usr/lib/rpm/redhat/tcl.req | sort -u + +# +# --- Kernel module imported symbols +# +# Since we don't (yet) get passed the name of the package being built, we +# cheat a little here by looking first for a kernel, then for a kmod. +# + +unset is_kmod + +for f in $filelist; do + if [ $(echo "$f" | sed -r -ne 's:^.*/lib/modules/(.*)/(.*).ko$:\2:p') ] + then + is_kmod=1; + elif [ $(echo "$f" | sed -r -ne 's:^.*/boot/(.*):\1:p') ] + then + unset is_kmod; + break; + fi +done + +# Disabling for now while the Fedora kernel doesn't produce kABI deps. +#[ -x /usr/lib/rpm/redhat/find-requires.ksyms ] && [ "$is_kmod" ] && +# printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/redhat/find-requires.ksyms + +exit 0 diff --git a/find-requires.ksyms b/find-requires.ksyms new file mode 100755 index 0000000..73525b7 --- /dev/null +++ b/find-requires.ksyms @@ -0,0 +1,48 @@ +#! /bin/bash + +IFS=$'\n' + +all_provides() { + nm "$@" \ + | sed -r -ne 's:^0*([0-9a-f]+) A __crc_(.+):\1\t\2:p' \ + | sort -k2 -u +} + +all_requires() { + for module in "$@"; do + set -- $(/sbin/modinfo -F vermagic "$module" | sed -e 's: .*::' -e q) + /sbin/modprobe --dump-modversions "$module" \ + | sed -r -e 's:^0x0*::' -e 's:$:\t'"$1"':' + done \ + | sort -k2 -u +} + +if ! [ -e /sbin/modinfo -a -e /sbin/modprobe ]; then + cat > /dev/null + exit 0 +fi + +modules=($(grep -E '/lib/modules/.+\.ko$')) +if [ ${#modules[@]} -gt 0 ]; then + symset_table=$(mktemp -t ${0##*/}.XXXXX) + /usr/lib/rpm/redhat/symset-table | sort > $symset_table + + join -t $'\t' -j 1 -a 2 $symset_table <( + # Filter out requirements that we fulfill ourself. + join -t $'\t' -j 2 -v 1 \ + <(all_requires "${modules[@]}") \ + <(all_provides "${modules[@]}") \ + | awk ' + BEGIN { FS = "\t" ; OFS = "\t" } + { print $3 "/" $2 "/" $1 } + ' \ + | sort -u) \ + | sort -u \ + | awk ' + { FS = "\t" ; OFS = "\t" } + NF == 3 { print "kernel(" $2 ") = " $3 + next } + { split($1, arr, "/") + print "ksym(" arr[3] ") = " arr[2] } + ' +fi diff --git a/find-requires.libtool b/find-requires.libtool new file mode 100755 index 0000000..4d95ddb --- /dev/null +++ b/find-requires.libtool @@ -0,0 +1,15 @@ +#!/bin/sh +while read possible ; do + case "$possible" in + *.la) + for dep in `grep ^dependency_libs= "$possible" 2> /dev/null | \ + sed -r -e "s,^dependency_libs='(.*)',\1,g"` ; do + case "$dep" in + /*.la) + echo "libtool($dep)" + ;; + esac + done + ;; + esac +done diff --git a/find-requires.pkgconfig b/find-requires.pkgconfig new file mode 100755 index 0000000..ff4f8bd --- /dev/null +++ b/find-requires.pkgconfig @@ -0,0 +1,11 @@ +#!/bin/bash +pkgconfig=${1:-/usr/bin/pkg-config} +test -x $pkgconfig || exit 0 +while read filename ; do +case "${filename}" in +*.pc) + $pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do + echo "pkgconfig($n)" "$r" "$v" + done +esac +done diff --git a/kmodtool b/kmodtool new file mode 100755 index 0000000..affad54 --- /dev/null +++ b/kmodtool @@ -0,0 +1,267 @@ +#!/bin/bash + +# kmodtool - Helper script for building kernel module RPMs +# Copyright (c) 2003-2006 Ville Skyttä , +# Thorsten Leemhuis +# Jon Masters +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +shopt -s extglob + +myprog="kmodtool" +myver="0.10.10_kmp2" +knownvariants=@(BOOT|PAE|@(big|huge)mem|debug|enterprise|kdump|?(large)smp|uml|xen[0U]?(-PAE)|xen) +kmod_name= +kver= +verrel= +variant= +kmp= + +get_verrel () +{ + verrel=${1:-$(uname -r)} + verrel=${verrel%%$knownvariants} +} + +print_verrel () +{ + get_verrel $@ + echo "${verrel}" +} + +get_variant () +{ + get_verrel $@ + variant=${1:-$(uname -r)} + variant=${variant##$verrel} + variant=${variant:-'""'} +} + +print_variant () +{ + get_variant $@ + echo "${variant}" +} + +get_rpmtemplate () +{ + local variant="${1}" + local dashvariant="${variant:+-${variant}}" + case "$verrel" in + *.el*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;; + *.EL*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;; + *) kdep="kernel-%{_target_cpu} = ${verrel}${variant}" ;; + esac + + echo "%package -n kmod-${kmod_name}${dashvariant}" + + if [ -z "$kmp_provides_summary" ]; then + echo "Summary: ${kmod_name} kernel module(s)" + fi + + if [ -z "$kmp_provides_group" ]; then + echo "Group: System Environment/Kernel" + fi + + if [ ! -z "$kmp_version" ]; then + echo "Version: %{kmp_version}" + fi + + if [ ! -z "$kmp_release" ]; then + echo "Release: %{kmp_release}" + fi + + if [ ! -z "$kmp" ]; then + echo "%global _use_internal_dependency_generator 0" + fi + + cat <= %{?epoch:%{epoch}:}%{version} +# + + cat < /dev/null || : +fi +EOF + + if [ ! -z "$kmp" ]; then + cat < /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules +EOF + + fi + + cat < /dev/null || : +EOF + + if [ ! -z "$kmp" ]; then + cat <&2 + exit 2 + elif [ -z "${kver}" ] ; then + echo "Please provide the kver as second parameter." >&2 + exit 2 + elif [ -z "${verrel}" ] ; then + echo "Couldn't find out the verrel." >&2 + exit 2 + fi + + for variant in "$@" ; do + if [ "default" == "$variant" ]; + then + get_rpmtemplate "" + else + get_rpmtemplate "${variant}" + fi + done +} + +usage () +{ + cat <