Группа :: Система/Настройка/Пакеты
Пакет: rpm
Главная Изменения Спек Патчи Загрузить Bugs and FR
# $Id: rpm-4_0.spec,v 1.123 2004/06/29 15:28:37 ldv Exp $
%define rpm_name rpm
%define rpm_version 4.0.4
%define srcname %rpm_name-4_0-%rpm_version
Name: %rpm_name
Version: %rpm_version
Release: alt40.M24.1
%define ifdef() %if %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
%define get_dep() %(rpm -q --qf '%%{NAME} >= %%|SERIAL?{%%{SERIAL}:}|%%{VERSION}-%%{RELEASE}' %1 2>/dev/null || echo '%1 >= unknown')
%define def_with() %{expand:%%{!?_with_%{1}: %%{!?_without_%{1}: %%global _with_%{1} --with-%{1}}}}
%define def_without() %{expand:%%{!?_with_%{1}: %%{!?_without_%{1}: %%global _without_%{1} --without-%{1}}}}
%define if_with() %if %{expand:%%{?_with_%{1}:1}%%{!?_with_%{1}:0}}
%define if_without() %if %{expand:%%{?_without_%{1}:1}%%{!?_without_%{1}:0}}
%def_with python
%def_without apidocs
%def_without db
%def_without contrib
%def_without build_topdir
# XXX enable at your own risk, CDB access to rpmdb isn't cooked yet.
%define enable_cdb create cdb
Summary: The RPM package management system
Summary(ru_RU.KOI8-R): Менеджер пакетов RPM
License: GPL
Group: System/Configuration/Packaging
Url: http://www.rpm.org/
# 1. ftp://ftp.rpm.org/pub/rpm/dist/
# 2. cvs -d :pserver:anonymous at cvs.rpm.org:/cvs/devel export -r rpm-4_0 rpm
# 3. ALT Linux CVS
Source: %srcname.tar.bz2
Patch: rpm-4.0-alt-python-pth.patch
Provides: %_sysconfdir/%name/macros.d
PreReq: lib%name = %version-%release, librpmbuild = %version-%release
PreReq: alt-gpgkeys, coreutils
# XXX glibc-2.1.92 has incompatible locale changes that affect statically
# XXX linked binaries like /bin/rpm.
Requires: glibc-core
%{?_with_python:BuildPreReq: python-devel = %__python_version}
%{?_with_apidocs:BuildPreReq: ctags doxygen}
BuildPreReq: automake >= 1.7.1, autoconf >= 2.53, rpm >= 3.0.6-ipl24mdk, %_bindir/subst
BuildConflicts: rpm-devel
# Automatically added by buildreq on Mon May 05 2003 and edited manually.
BuildRequires: bzlib-devel-static glibc-devel-static libbeecrypt-devel-static libdb4.2-devel-static libpopt-devel-static zlib-devel-static
%package -n lib%name
Summary: Shared libraries required for applications which will manipulate RPM packages
Summary(ru_RU.KOI8-R): Файлы, необходимые для разработки приложений, взаимодействующих с RPM-пакетами
Group: System/Libraries
PreReq: zlib >= 1.1.4
PreReq: bzlib >= 1:1.0.2-alt2
PreReq: libpopt >= 1:1.7-alt3
PreReq: libbeecrypt >= 2.2.0-alt1
PreReq: libdb4.2
%package -n librpmbuild
Summary: Shared library required for applications which will build RPM packages
Summary(ru_RU.KOI8-R): Разделяемая библиотека для разработки приложений, собирающих RPM-пакеты
Group: System/Libraries
Requires: lib%name = %version-%release
%package -n lib%name-devel
Summary: Development files for applications which will manipulate RPM packages
Summary(ru_RU.KOI8-R): Файлы, необходимые для разработки приложений, взаимодействующих с RPM-пакетами
Group: Development/C
Provides: %name-devel = %version-%release
Obsoletes: %name-devel
Requires: lib%name = %version-%release, librpmbuild = %version-%release
Requires: bzlib-devel, libbeecrypt-devel, libdb4.2-devel, libpopt-devel, zlib-devel
%package -n lib%name-devel-static
Summary: Static libraries for developing statically linked applications which will manipulate RPM packages
Summary(ru_RU.KOI8-R): Статические библиотеки, необходимые для разработки статических приложений, взаимодействующих с RPM-пакетами
Group: Development/C
Requires: lib%name-devel = %version-%release
Requires: bzlib-devel-static, libbeecrypt-devel-static, libdb4.2-devel-static, libpopt-devel-static, zlib-devel-static
%package build
Summary: Scripts and executable programs used to build packages
Summary(ru_RU.KOI8-R): Файлы, необходимые для установки SRPM-пакетов и сборки RPM-пакетов
Group: Development/Other
Obsoletes: spec-helper
PreReq: librpmbuild = %version-%release, %name = %version-%release
PreReq: shadow-utils
Requires: autoconf autoconf-common automake automake-common bison coreutils cpio
Requires: gcc gettext-tools glibc-devel file kernel-headers libtool m4 make
Requires: net-tools procps psmisc sed service sh texinfo which
Requires: bzip2 >= 1:1.0.2-alt4
Requires: gzip >= 0:1.3.3-alt2
Requires: info-install >= 0:4.5-alt2
Requires: mktemp >= 1:1.3.1
Requires: patch >= 2.5
Requires: tar >= 0:1.13.22-alt1
Requires: %_bindir/subst
Requires: rpm-build-perl
Requires: rpm-build-python
%package build-topdir
Summary: RPM package installation and build directory tree
Summary(ru_RU.KOI8-R): Сборочное дерево, используемое для установки SRPM-пакетов и сборки RPM-пакетов
Group: Development/Other
PreReq: %name-build = %version-%release
%package static
Summary: Static version of the RPM package management system
Summary(ru_RU.KOI8-R): Статическая версия менеджера пакетов RPM
Group: System/Configuration/Packaging
PreReq: %name = %version-%release
%package contrib
Summary: Contributed scripts and executable programs which aren't currently used
Summary(ru_RU.KOI8-R): Файлы, не используемые в настоящее время
Group: Development/Other
PreReq: %name-build = %version-%release
%description
The RPM Package Manager (RPM) is a powerful command line driven
package management system capable of installing, uninstalling,
verifying, querying, and updating software packages. Each software
package consists of an archive of files along with information about
the package like its version, a description, etc.
%description -l ru_RU.KOI8-R
RPM - это мощный неинтерактивный менеджер пакетов, используемый для сборки,
установки, инспекции, проверки, обновления и удаления отдельных программных
пакетов. Каждый такой пакет состоит из набора файлов и информации о пакете,
включающей название, версию, описание пакета, и т.д.
%description -n lib%name
This package contains shared libraries required to run dynamically linked
programs manipulating with RPM packages and databases.
%description -n librpmbuild
This package contains shared library required to run dynamically linked
programs building RPM packages.
%description -n lib%name-devel
This package contains the RPM C library and header files. These
development files will simplify the process of writing programs
which manipulate RPM packages and databases and are intended to make
it easier to create graphical package managers or any other tools
that need an intimate knowledge of RPM packages in order to function.
This package should be installed if you want to develop programs that
will manipulate RPM packages and databases.
%description -n lib%name-devel-static
This package contains the RPM C library and header files. These
development files will simplify the process of writing programs
which manipulate RPM packages and databases and are intended to make
it easier to create graphical package managers or any other tools
that need an intimate knowledge of RPM packages in order to function.
This package should be installed if you want to develop statically linked
programs that will manipulate RPM packages and databases.
%description build
This package contains scripts and executable programs that are used to
build packages using RPM.
%description build-topdir
This package contains RPM package installation and build directory tree.
%description static
This package contains statically linked version of the RPM program.
%description contrib
This package contains extra scripts and executable programs which arent
currently used.
%if_with python
%package python
Version: %{rpm_version}_%__python_version
Summary: Python bindings for apps which will manipulate RPM packages
Summary(ru_RU.KOI8-R): Интерфейс для разработки Python-приложений, взаимодействующих с RPM-пакетами
Group: Development/Python
PreReq: lib%name = %rpm_version-%release
Requires: python = %__python_version
%description python
The %name-python package contains a module which permits applications
written in the Python programming language to use the interface
supplied by RPM (RPM Package Manager) libraries.
This package should be installed if you want to develop Python
programs that will manipulate RPM packages and databases.
%endif #with python
%prep
%setup -q -n %srcname
%patch -p1
find -type d -name CVS -print0 |
xargs -r0 %__rm -rf --
find -type f \( -name .cvsignore -o -name \*~ -o -name \*.orig \) -print0 |
xargs -r0 %__rm -f --
%build
gettextize --force --quiet
%__install -pv -m644 /usr/share/gettext/intl/Makevars* po/Makevars
autoreconf -fisv -I m4
export \
ac_cv_path_CTAGS=/usr/bin/ctags \
ac_cv_path_UNZIPBIN=/usr/bin/unzip \
ac_cv_path___CPIO=/bin/cpio \
ac_cv_path___GPG=/usr/bin/gpg \
ac_cv_path___SSH=/usr/bin/ssh \
#
%configure \
%{?_with_python} %{?_without_python} \
%{?_with_apidocs} %{?_without_apidocs} \
%{?_with_db} %{?_without_db} \
--program-transform-name=
# fix buggy requires if any
find scripts -type f -print0 |
xargs -r0 %__grep -EZl '(/usr/ucb|/usr/local/bin/perl|/usr/local/lib/rpm/bash)' -- |
xargs -r0 subst 's|/usr/ucb|%_bindir|g;s|/usr/local/bin/perl|/usr/bin/perl|g;s|/usr/local/lib/rpm/bash|/bin/sh|g' --
find -type f -print0 |
xargs -r0 %__grep -FZl /usr/sbin/lsattr -- |
xargs -r0 subst 's|/usr/sbin/lsattr|/usr/bin/lsattr|g' --
# fix vendor
find -type f -print0 |
xargs -r0 %__grep -FZl '%_host_cpu-pc-%_host_os' -- |
xargs -r0 subst 's/%_host_cpu-pc-%_host_os/%_host_cpu-alt-%_host_os/g' --
find -type f -name config.\* -print0 |
xargs -r0 %__grep -FZl '=pc' -- |
xargs -r0 subst 's/=pc/=alt/g' --
%make_build YACC='bison -y'
%if_with apidocs
%__rm -rf apidocs
make apidocs
%endif #with apidocs
%install
%make_install DESTDIR="$RPM_BUILD_ROOT" install
%__chmod a-w $RPM_BUILD_ROOT%_usrsrc/RPM{,/RPMS/*}
# Save list of packages through cron.
#%__mkdir_p $RPM_BUILD_ROOT%_sysconfdir/cron.daily
#%__install -p -m750 scripts/%name.daily $RPM_BUILD_ROOT%_sysconfdir/cron.daily/%name
#
#%__mkdir_p $RPM_BUILD_ROOT%_sysconfdir/logrotate.d
#%__install -p -m640 scripts/%name.log $RPM_BUILD_ROOT%_sysconfdir/logrotate.d/%name
%__mkdir_p $RPM_BUILD_ROOT%_sysconfdir/%name/macros.d
touch $RPM_BUILD_ROOT%_sysconfdir/%name/macros
cat << E_O_F > $RPM_BUILD_ROOT%_sysconfdir/%name/macros.db1
%%_dbapi 1
E_O_F
cat << E_O_F > $RPM_BUILD_ROOT%_sysconfdir/%name/macros.cdb
%{?enable_cdb:#%%__dbi_cdb %enable_cdb}
E_O_F
%__mkdir_p $RPM_BUILD_ROOT%_localstatedir/%name
for dbi in \
Basenames Conflictname Dirnames Group Installtid Name Providename \
Provideversion Removetid Requirename Requireversion Triggername \
Sigmd5 Sha1header Filemd5s Packages \
__db.001 __db.002 __db.003 __db.004 __db.005 __db.006 __db.007 \
__db.008 __db.009
do
touch "$RPM_BUILD_ROOT%_localstatedir/%name/$dbi"
done
# Prepare documentation.
bzip2 -9 CHANGES ||:
%__mkdir_p $RPM_BUILD_ROOT%_docdir/%name-%rpm_version
%__install -p -m644 CHANGES* CREDITS README README.ALT* RPM-GPG-KEY RPM-PGP-KEY TODO \
$RPM_BUILD_ROOT%_docdir/%name-%rpm_version/
%__cp -a doc/manual $RPM_BUILD_ROOT%_docdir/%name-%rpm_version/
%__rm -f $RPM_BUILD_ROOT%_docdir/%name-%rpm_version/manual/{Makefile*,buildroot}
%if_with apidocs
%__cp -a apidocs/man/man3 $RPM_BUILD_ROOT%_mandir/
%__cp -a apidocs/html $RPM_BUILD_ROOT%_docdir/%name-%rpm_version/apidocs/
%endif #with apidocs
# rpminit(1).
%__install -pD -m755 rpminit $RPM_BUILD_ROOT%_bindir/rpminit
%__install -pD -m644 rpminit.1 $RPM_BUILD_ROOT%_man1dir/rpminit.1
# Valid groups.
%__install -p -m644 GROUPS $RPM_BUILD_ROOT%_libdir/%name/
# buildreq ignore rules.
%__install -pD -m644 rpm-build.buildreq $RPM_BUILD_ROOT%_sysconfdir/buildreqs/files/ignore.d/rpm-build
chmod a+x scripts/find-lang
# Manpages have been moved to their own packages.
#./scripts/find-lang --with-man %name rpm2cpio --output %name.lang
RPMCONFIGDIR=./scripts ./scripts/find-lang %name rpm2cpio --output %name.lang
pushd $RPM_BUILD_ROOT%_libdir/%name
for f in *-alt-%_target_os; do
n=`echo "$f" |%__sed -e 's/-alt//'`
[ -e "$n" ] || %__ln_s "$f" "$n"
done
popd
/bin/ls -1d $RPM_BUILD_ROOT%_libdir/%name/*-%_target_os |
%__grep -Fv /brp- |
%__sed -e "s|^$RPM_BUILD_ROOT|%attr(-,root,%name) |g" >>%name.lang
%pre
if [ -f %_localstatedir/%name/Packages -a -f %_localstatedir/%name/packages.rpm ]; then
echo "
You have both
%_localstatedir/%name/packages.rpm db1 format installed package headers
%_localstatedir/%name/Packages db3 format installed package headers
Please remove (or at least rename) one of those files, and re-install.
" >&2
exit 1
fi
%post
if [ -f %_localstatedir/%name/packages.rpm ]; then
%__chgrp %name %_localstatedir/%name/*.rpm
# Migrate to db3 database.
%_libdir/%name/pdeath_execute $PPID %_libdir/%name/delayed_rebuilddb
elif [ -f %_localstatedir/%name/Packages ]; then
%__chgrp %name %_localstatedir/%name/[A-Z]*
# Undo db1 configuration.
%__rm -f %_sysconfdir/%name/macros.db1
[ -n "$DURING_INSTALL" -o -n "$BTE_INSTALL" ] ||
%_libdir/%name/pdeath_execute $PPID %_libdir/%name/delayed_rebuilddb
else
# Initialize db3 database.
%__rm -f %_sysconfdir/%name/macros.db1
%_bindir/rpmdb --initdb
fi
:
%post -n lib%name -p /sbin/post_ldconfig
%postun -n lib%name -p /sbin/postun_ldconfig
%post -n librpmbuild -p /sbin/post_ldconfig
%postun -n librpmbuild -p /sbin/postun_ldconfig
%files -n librpmbuild
%_libdir/librpmbuild-*.so
%define rpmattr %attr(755,root,%name)
%define rpmdirattr %attr(2755,root,%name) %dir
%define rpmdatattr %attr(644,root,%name)
%define rpmdbattr %attr(644,root,%name) %verify(not md5 size mtime) %ghost %config(missingok,noreplace)
%files -n lib%name
%rpmdirattr %_libdir/%name
%rpmdatattr %_libdir/%name/rpmrc
%rpmdatattr %_libdir/%name/macros
%_libdir/librpm-*.so
%_libdir/librpmdb-*.so
%_libdir/librpmio-*.so
%files -n lib%name-devel
%_libdir/librpm.so
%_libdir/librpmdb.so
%_libdir/librpmio.so
%_libdir/librpmbuild.so
%_includedir/%name
%if_with apidocs
%_man3dir/*
%dir %_docdir/%name-%rpm_version
%_docdir/%name-%rpm_version/apidocs
%endif #with apidocs
%files -n lib%name-devel-static
%_libdir/*.a
%files -f %name.lang
%dir %_docdir/%name-%rpm_version
%_docdir/%name-%rpm_version/[A-Z]*
%_docdir/%name-%rpm_version/manual
#%config(noreplace,missingok) %_sysconfdir/cron.daily/%name
#%config(noreplace,missingok) %_sysconfdir/logrotate.d/%name
%dir %_sysconfdir/%name
%dir %_sysconfdir/%name/macros.d
%config(noreplace,missingok) %_sysconfdir/%name/macros
%config(noreplace,missingok) %_sysconfdir/%name/macros.??*
%rpmdirattr %_localstatedir/%name
%rpmdbattr %_localstatedir/%name/Basenames
%rpmdbattr %_localstatedir/%name/Conflictname
%rpmdbattr %_localstatedir/%name/__db.0*
%rpmdbattr %_localstatedir/%name/Dirnames
%rpmdbattr %_localstatedir/%name/Filemd5s
%rpmdbattr %_localstatedir/%name/Group
%rpmdbattr %_localstatedir/%name/Installtid
%rpmdbattr %_localstatedir/%name/Name
%rpmdbattr %_localstatedir/%name/Packages
%rpmdbattr %_localstatedir/%name/Providename
%rpmdbattr %_localstatedir/%name/Provideversion
%rpmdbattr %_localstatedir/%name/Removetid
%rpmdbattr %_localstatedir/%name/Requirename
%rpmdbattr %_localstatedir/%name/Requireversion
%rpmdbattr %_localstatedir/%name/Sigmd5
%rpmdbattr %_localstatedir/%name/Sha1header
%rpmdbattr %_localstatedir/%name/Triggername
/bin/rpm
%_bindir/rpm
%_bindir/rpm2cpio
%_bindir/rpmdb
%_bindir/rpm[eiu]
%_bindir/rpmsign
%_bindir/rpmquery
%_bindir/rpmverify
%_bindir/rpminit
%rpmdirattr %_libdir/%name
%rpmattr %_libdir/%name/delayed_rebuilddb
%rpmattr %_libdir/%name/pdeath_execute
%rpmattr %_libdir/%name/rpm[dikq]
%_libdir/%name/rpm[euv]
%rpmdatattr %_libdir/%name/rpmpopt*
%rpmdatattr %_libdir/%name/GROUPS
%_libdir/rpmpopt
%_libdir/rpmrc
%_man1dir/rpminit.*
%_man8dir/rpm.*
%_man8dir/rpm2cpio.*
%files build
%config %_sysconfdir/buildreqs/files/ignore.d/*
%rpmattr %_bindir/gendiff
%_bindir/rpmbuild
%_bindir/relative
%rpmdirattr %_libdir/%name
%_libdir/%name/rpmt
%rpmattr %_libdir/%name/rpmb
%rpmattr %_libdir/%name/filesize
%rpmattr %_libdir/%name/relative
%rpmattr %_libdir/%name/functions
%rpmattr %_libdir/%name/brp-*
%rpmattr %_libdir/%name/*_files
%rpmattr %_libdir/%name/check-files
%rpmattr %_libdir/%name/convertrpmrc.sh
%rpmattr %_libdir/%name/rpm2cpio.sh
%rpmattr %_libdir/%name/find-lang
%rpmattr %_libdir/%name/find-package
%rpmattr %_libdir/%name/find-provides
%rpmattr %_libdir/%name/find-requires
%rpmattr %_libdir/%name/fixup-*
%rpmattr %_libdir/%name/http.req
%rpmattr %_libdir/%name/files.*
%rpmattr %_libdir/%name/pam.*
%rpmattr %_libdir/%name/shell.*
%rpmattr %_libdir/%name/sql.*
%rpmattr %_libdir/%name/tcl.*
%rpmattr %_libdir/%name/verify-elf
%rpmattr %_libdir/%name/Specfile.pm
%_mandir/man?/gendiff.*
%_man8dir/rpmbuild.*
%if_with build_topdir
%files build-topdir
%attr(0755,root,%name) %dir %_usrsrc/RPM
%attr(0770,root,%name) %dir %_usrsrc/RPM/BUILD
%attr(2770,root,%name) %dir %_usrsrc/RPM/SPECS
%attr(2770,root,%name) %dir %_usrsrc/RPM/SOURCES
%attr(2775,root,%name) %dir %_usrsrc/RPM/SRPMS
%attr(0755,root,%name) %dir %_usrsrc/RPM/RPMS
%attr(2775,root,%name) %dir %_usrsrc/RPM/RPMS/*
%endif #with build_topdir
%if_with python
%files python
%_libdir/python*/site-packages/*module.so
%endif #with python
%files static
%_bindir/rpm.static
%if_with contrib
%files contrib
%rpmattr %dir %_libdir/%name
%rpmattr %_libdir/%name/cpanflute*
%rpmattr %_libdir/%name/cross-build
%rpmattr %_libdir/%name/find-prov.pl
%rpmattr %_libdir/%name/find-provides.perl
%rpmattr %_libdir/%name/find-req.pl
%rpmattr %_libdir/%name/find-requires.perl
%rpmattr %_libdir/%name/get_magic.pl
%rpmattr %_libdir/%name/getpo.sh
%rpmattr %_libdir/%name/javadeps
%rpmattr %_libdir/%name/magic.*
%rpmattr %_libdir/%name/rpmdiff*
%rpmattr %_libdir/%name/trpm
%rpmattr %_libdir/%name/u_pkg.sh
%rpmattr %_libdir/%name/vpkg-provides.sh
%rpmattr %_libdir/%name/vpkg-provides2.sh
%endif #with contrib
%changelog
…
Полный changelog можно просмотреть здесь
%define rpm_name rpm
%define rpm_version 4.0.4
%define srcname %rpm_name-4_0-%rpm_version
Name: %rpm_name
Version: %rpm_version
Release: alt40.M24.1
%define ifdef() %if %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
%define get_dep() %(rpm -q --qf '%%{NAME} >= %%|SERIAL?{%%{SERIAL}:}|%%{VERSION}-%%{RELEASE}' %1 2>/dev/null || echo '%1 >= unknown')
%define def_with() %{expand:%%{!?_with_%{1}: %%{!?_without_%{1}: %%global _with_%{1} --with-%{1}}}}
%define def_without() %{expand:%%{!?_with_%{1}: %%{!?_without_%{1}: %%global _without_%{1} --without-%{1}}}}
%define if_with() %if %{expand:%%{?_with_%{1}:1}%%{!?_with_%{1}:0}}
%define if_without() %if %{expand:%%{?_without_%{1}:1}%%{!?_without_%{1}:0}}
%def_with python
%def_without apidocs
%def_without db
%def_without contrib
%def_without build_topdir
# XXX enable at your own risk, CDB access to rpmdb isn't cooked yet.
%define enable_cdb create cdb
Summary: The RPM package management system
Summary(ru_RU.KOI8-R): Менеджер пакетов RPM
License: GPL
Group: System/Configuration/Packaging
Url: http://www.rpm.org/
# 1. ftp://ftp.rpm.org/pub/rpm/dist/
# 2. cvs -d :pserver:anonymous at cvs.rpm.org:/cvs/devel export -r rpm-4_0 rpm
# 3. ALT Linux CVS
Source: %srcname.tar.bz2
Patch: rpm-4.0-alt-python-pth.patch
Provides: %_sysconfdir/%name/macros.d
PreReq: lib%name = %version-%release, librpmbuild = %version-%release
PreReq: alt-gpgkeys, coreutils
# XXX glibc-2.1.92 has incompatible locale changes that affect statically
# XXX linked binaries like /bin/rpm.
Requires: glibc-core
%{?_with_python:BuildPreReq: python-devel = %__python_version}
%{?_with_apidocs:BuildPreReq: ctags doxygen}
BuildPreReq: automake >= 1.7.1, autoconf >= 2.53, rpm >= 3.0.6-ipl24mdk, %_bindir/subst
BuildConflicts: rpm-devel
# Automatically added by buildreq on Mon May 05 2003 and edited manually.
BuildRequires: bzlib-devel-static glibc-devel-static libbeecrypt-devel-static libdb4.2-devel-static libpopt-devel-static zlib-devel-static
%package -n lib%name
Summary: Shared libraries required for applications which will manipulate RPM packages
Summary(ru_RU.KOI8-R): Файлы, необходимые для разработки приложений, взаимодействующих с RPM-пакетами
Group: System/Libraries
PreReq: zlib >= 1.1.4
PreReq: bzlib >= 1:1.0.2-alt2
PreReq: libpopt >= 1:1.7-alt3
PreReq: libbeecrypt >= 2.2.0-alt1
PreReq: libdb4.2
%package -n librpmbuild
Summary: Shared library required for applications which will build RPM packages
Summary(ru_RU.KOI8-R): Разделяемая библиотека для разработки приложений, собирающих RPM-пакеты
Group: System/Libraries
Requires: lib%name = %version-%release
%package -n lib%name-devel
Summary: Development files for applications which will manipulate RPM packages
Summary(ru_RU.KOI8-R): Файлы, необходимые для разработки приложений, взаимодействующих с RPM-пакетами
Group: Development/C
Provides: %name-devel = %version-%release
Obsoletes: %name-devel
Requires: lib%name = %version-%release, librpmbuild = %version-%release
Requires: bzlib-devel, libbeecrypt-devel, libdb4.2-devel, libpopt-devel, zlib-devel
%package -n lib%name-devel-static
Summary: Static libraries for developing statically linked applications which will manipulate RPM packages
Summary(ru_RU.KOI8-R): Статические библиотеки, необходимые для разработки статических приложений, взаимодействующих с RPM-пакетами
Group: Development/C
Requires: lib%name-devel = %version-%release
Requires: bzlib-devel-static, libbeecrypt-devel-static, libdb4.2-devel-static, libpopt-devel-static, zlib-devel-static
%package build
Summary: Scripts and executable programs used to build packages
Summary(ru_RU.KOI8-R): Файлы, необходимые для установки SRPM-пакетов и сборки RPM-пакетов
Group: Development/Other
Obsoletes: spec-helper
PreReq: librpmbuild = %version-%release, %name = %version-%release
PreReq: shadow-utils
Requires: autoconf autoconf-common automake automake-common bison coreutils cpio
Requires: gcc gettext-tools glibc-devel file kernel-headers libtool m4 make
Requires: net-tools procps psmisc sed service sh texinfo which
Requires: bzip2 >= 1:1.0.2-alt4
Requires: gzip >= 0:1.3.3-alt2
Requires: info-install >= 0:4.5-alt2
Requires: mktemp >= 1:1.3.1
Requires: patch >= 2.5
Requires: tar >= 0:1.13.22-alt1
Requires: %_bindir/subst
Requires: rpm-build-perl
Requires: rpm-build-python
%package build-topdir
Summary: RPM package installation and build directory tree
Summary(ru_RU.KOI8-R): Сборочное дерево, используемое для установки SRPM-пакетов и сборки RPM-пакетов
Group: Development/Other
PreReq: %name-build = %version-%release
%package static
Summary: Static version of the RPM package management system
Summary(ru_RU.KOI8-R): Статическая версия менеджера пакетов RPM
Group: System/Configuration/Packaging
PreReq: %name = %version-%release
%package contrib
Summary: Contributed scripts and executable programs which aren't currently used
Summary(ru_RU.KOI8-R): Файлы, не используемые в настоящее время
Group: Development/Other
PreReq: %name-build = %version-%release
%description
The RPM Package Manager (RPM) is a powerful command line driven
package management system capable of installing, uninstalling,
verifying, querying, and updating software packages. Each software
package consists of an archive of files along with information about
the package like its version, a description, etc.
%description -l ru_RU.KOI8-R
RPM - это мощный неинтерактивный менеджер пакетов, используемый для сборки,
установки, инспекции, проверки, обновления и удаления отдельных программных
пакетов. Каждый такой пакет состоит из набора файлов и информации о пакете,
включающей название, версию, описание пакета, и т.д.
%description -n lib%name
This package contains shared libraries required to run dynamically linked
programs manipulating with RPM packages and databases.
%description -n librpmbuild
This package contains shared library required to run dynamically linked
programs building RPM packages.
%description -n lib%name-devel
This package contains the RPM C library and header files. These
development files will simplify the process of writing programs
which manipulate RPM packages and databases and are intended to make
it easier to create graphical package managers or any other tools
that need an intimate knowledge of RPM packages in order to function.
This package should be installed if you want to develop programs that
will manipulate RPM packages and databases.
%description -n lib%name-devel-static
This package contains the RPM C library and header files. These
development files will simplify the process of writing programs
which manipulate RPM packages and databases and are intended to make
it easier to create graphical package managers or any other tools
that need an intimate knowledge of RPM packages in order to function.
This package should be installed if you want to develop statically linked
programs that will manipulate RPM packages and databases.
%description build
This package contains scripts and executable programs that are used to
build packages using RPM.
%description build-topdir
This package contains RPM package installation and build directory tree.
%description static
This package contains statically linked version of the RPM program.
%description contrib
This package contains extra scripts and executable programs which arent
currently used.
%if_with python
%package python
Version: %{rpm_version}_%__python_version
Summary: Python bindings for apps which will manipulate RPM packages
Summary(ru_RU.KOI8-R): Интерфейс для разработки Python-приложений, взаимодействующих с RPM-пакетами
Group: Development/Python
PreReq: lib%name = %rpm_version-%release
Requires: python = %__python_version
%description python
The %name-python package contains a module which permits applications
written in the Python programming language to use the interface
supplied by RPM (RPM Package Manager) libraries.
This package should be installed if you want to develop Python
programs that will manipulate RPM packages and databases.
%endif #with python
%prep
%setup -q -n %srcname
%patch -p1
find -type d -name CVS -print0 |
xargs -r0 %__rm -rf --
find -type f \( -name .cvsignore -o -name \*~ -o -name \*.orig \) -print0 |
xargs -r0 %__rm -f --
%build
gettextize --force --quiet
%__install -pv -m644 /usr/share/gettext/intl/Makevars* po/Makevars
autoreconf -fisv -I m4
export \
ac_cv_path_CTAGS=/usr/bin/ctags \
ac_cv_path_UNZIPBIN=/usr/bin/unzip \
ac_cv_path___CPIO=/bin/cpio \
ac_cv_path___GPG=/usr/bin/gpg \
ac_cv_path___SSH=/usr/bin/ssh \
#
%configure \
%{?_with_python} %{?_without_python} \
%{?_with_apidocs} %{?_without_apidocs} \
%{?_with_db} %{?_without_db} \
--program-transform-name=
# fix buggy requires if any
find scripts -type f -print0 |
xargs -r0 %__grep -EZl '(/usr/ucb|/usr/local/bin/perl|/usr/local/lib/rpm/bash)' -- |
xargs -r0 subst 's|/usr/ucb|%_bindir|g;s|/usr/local/bin/perl|/usr/bin/perl|g;s|/usr/local/lib/rpm/bash|/bin/sh|g' --
find -type f -print0 |
xargs -r0 %__grep -FZl /usr/sbin/lsattr -- |
xargs -r0 subst 's|/usr/sbin/lsattr|/usr/bin/lsattr|g' --
# fix vendor
find -type f -print0 |
xargs -r0 %__grep -FZl '%_host_cpu-pc-%_host_os' -- |
xargs -r0 subst 's/%_host_cpu-pc-%_host_os/%_host_cpu-alt-%_host_os/g' --
find -type f -name config.\* -print0 |
xargs -r0 %__grep -FZl '=pc' -- |
xargs -r0 subst 's/=pc/=alt/g' --
%make_build YACC='bison -y'
%if_with apidocs
%__rm -rf apidocs
make apidocs
%endif #with apidocs
%install
%make_install DESTDIR="$RPM_BUILD_ROOT" install
%__chmod a-w $RPM_BUILD_ROOT%_usrsrc/RPM{,/RPMS/*}
# Save list of packages through cron.
#%__mkdir_p $RPM_BUILD_ROOT%_sysconfdir/cron.daily
#%__install -p -m750 scripts/%name.daily $RPM_BUILD_ROOT%_sysconfdir/cron.daily/%name
#
#%__mkdir_p $RPM_BUILD_ROOT%_sysconfdir/logrotate.d
#%__install -p -m640 scripts/%name.log $RPM_BUILD_ROOT%_sysconfdir/logrotate.d/%name
%__mkdir_p $RPM_BUILD_ROOT%_sysconfdir/%name/macros.d
touch $RPM_BUILD_ROOT%_sysconfdir/%name/macros
cat << E_O_F > $RPM_BUILD_ROOT%_sysconfdir/%name/macros.db1
%%_dbapi 1
E_O_F
cat << E_O_F > $RPM_BUILD_ROOT%_sysconfdir/%name/macros.cdb
%{?enable_cdb:#%%__dbi_cdb %enable_cdb}
E_O_F
%__mkdir_p $RPM_BUILD_ROOT%_localstatedir/%name
for dbi in \
Basenames Conflictname Dirnames Group Installtid Name Providename \
Provideversion Removetid Requirename Requireversion Triggername \
Sigmd5 Sha1header Filemd5s Packages \
__db.001 __db.002 __db.003 __db.004 __db.005 __db.006 __db.007 \
__db.008 __db.009
do
touch "$RPM_BUILD_ROOT%_localstatedir/%name/$dbi"
done
# Prepare documentation.
bzip2 -9 CHANGES ||:
%__mkdir_p $RPM_BUILD_ROOT%_docdir/%name-%rpm_version
%__install -p -m644 CHANGES* CREDITS README README.ALT* RPM-GPG-KEY RPM-PGP-KEY TODO \
$RPM_BUILD_ROOT%_docdir/%name-%rpm_version/
%__cp -a doc/manual $RPM_BUILD_ROOT%_docdir/%name-%rpm_version/
%__rm -f $RPM_BUILD_ROOT%_docdir/%name-%rpm_version/manual/{Makefile*,buildroot}
%if_with apidocs
%__cp -a apidocs/man/man3 $RPM_BUILD_ROOT%_mandir/
%__cp -a apidocs/html $RPM_BUILD_ROOT%_docdir/%name-%rpm_version/apidocs/
%endif #with apidocs
# rpminit(1).
%__install -pD -m755 rpminit $RPM_BUILD_ROOT%_bindir/rpminit
%__install -pD -m644 rpminit.1 $RPM_BUILD_ROOT%_man1dir/rpminit.1
# Valid groups.
%__install -p -m644 GROUPS $RPM_BUILD_ROOT%_libdir/%name/
# buildreq ignore rules.
%__install -pD -m644 rpm-build.buildreq $RPM_BUILD_ROOT%_sysconfdir/buildreqs/files/ignore.d/rpm-build
chmod a+x scripts/find-lang
# Manpages have been moved to their own packages.
#./scripts/find-lang --with-man %name rpm2cpio --output %name.lang
RPMCONFIGDIR=./scripts ./scripts/find-lang %name rpm2cpio --output %name.lang
pushd $RPM_BUILD_ROOT%_libdir/%name
for f in *-alt-%_target_os; do
n=`echo "$f" |%__sed -e 's/-alt//'`
[ -e "$n" ] || %__ln_s "$f" "$n"
done
popd
/bin/ls -1d $RPM_BUILD_ROOT%_libdir/%name/*-%_target_os |
%__grep -Fv /brp- |
%__sed -e "s|^$RPM_BUILD_ROOT|%attr(-,root,%name) |g" >>%name.lang
%pre
if [ -f %_localstatedir/%name/Packages -a -f %_localstatedir/%name/packages.rpm ]; then
echo "
You have both
%_localstatedir/%name/packages.rpm db1 format installed package headers
%_localstatedir/%name/Packages db3 format installed package headers
Please remove (or at least rename) one of those files, and re-install.
" >&2
exit 1
fi
%post
if [ -f %_localstatedir/%name/packages.rpm ]; then
%__chgrp %name %_localstatedir/%name/*.rpm
# Migrate to db3 database.
%_libdir/%name/pdeath_execute $PPID %_libdir/%name/delayed_rebuilddb
elif [ -f %_localstatedir/%name/Packages ]; then
%__chgrp %name %_localstatedir/%name/[A-Z]*
# Undo db1 configuration.
%__rm -f %_sysconfdir/%name/macros.db1
[ -n "$DURING_INSTALL" -o -n "$BTE_INSTALL" ] ||
%_libdir/%name/pdeath_execute $PPID %_libdir/%name/delayed_rebuilddb
else
# Initialize db3 database.
%__rm -f %_sysconfdir/%name/macros.db1
%_bindir/rpmdb --initdb
fi
:
%post -n lib%name -p /sbin/post_ldconfig
%postun -n lib%name -p /sbin/postun_ldconfig
%post -n librpmbuild -p /sbin/post_ldconfig
%postun -n librpmbuild -p /sbin/postun_ldconfig
%files -n librpmbuild
%_libdir/librpmbuild-*.so
%define rpmattr %attr(755,root,%name)
%define rpmdirattr %attr(2755,root,%name) %dir
%define rpmdatattr %attr(644,root,%name)
%define rpmdbattr %attr(644,root,%name) %verify(not md5 size mtime) %ghost %config(missingok,noreplace)
%files -n lib%name
%rpmdirattr %_libdir/%name
%rpmdatattr %_libdir/%name/rpmrc
%rpmdatattr %_libdir/%name/macros
%_libdir/librpm-*.so
%_libdir/librpmdb-*.so
%_libdir/librpmio-*.so
%files -n lib%name-devel
%_libdir/librpm.so
%_libdir/librpmdb.so
%_libdir/librpmio.so
%_libdir/librpmbuild.so
%_includedir/%name
%if_with apidocs
%_man3dir/*
%dir %_docdir/%name-%rpm_version
%_docdir/%name-%rpm_version/apidocs
%endif #with apidocs
%files -n lib%name-devel-static
%_libdir/*.a
%files -f %name.lang
%dir %_docdir/%name-%rpm_version
%_docdir/%name-%rpm_version/[A-Z]*
%_docdir/%name-%rpm_version/manual
#%config(noreplace,missingok) %_sysconfdir/cron.daily/%name
#%config(noreplace,missingok) %_sysconfdir/logrotate.d/%name
%dir %_sysconfdir/%name
%dir %_sysconfdir/%name/macros.d
%config(noreplace,missingok) %_sysconfdir/%name/macros
%config(noreplace,missingok) %_sysconfdir/%name/macros.??*
%rpmdirattr %_localstatedir/%name
%rpmdbattr %_localstatedir/%name/Basenames
%rpmdbattr %_localstatedir/%name/Conflictname
%rpmdbattr %_localstatedir/%name/__db.0*
%rpmdbattr %_localstatedir/%name/Dirnames
%rpmdbattr %_localstatedir/%name/Filemd5s
%rpmdbattr %_localstatedir/%name/Group
%rpmdbattr %_localstatedir/%name/Installtid
%rpmdbattr %_localstatedir/%name/Name
%rpmdbattr %_localstatedir/%name/Packages
%rpmdbattr %_localstatedir/%name/Providename
%rpmdbattr %_localstatedir/%name/Provideversion
%rpmdbattr %_localstatedir/%name/Removetid
%rpmdbattr %_localstatedir/%name/Requirename
%rpmdbattr %_localstatedir/%name/Requireversion
%rpmdbattr %_localstatedir/%name/Sigmd5
%rpmdbattr %_localstatedir/%name/Sha1header
%rpmdbattr %_localstatedir/%name/Triggername
/bin/rpm
%_bindir/rpm
%_bindir/rpm2cpio
%_bindir/rpmdb
%_bindir/rpm[eiu]
%_bindir/rpmsign
%_bindir/rpmquery
%_bindir/rpmverify
%_bindir/rpminit
%rpmdirattr %_libdir/%name
%rpmattr %_libdir/%name/delayed_rebuilddb
%rpmattr %_libdir/%name/pdeath_execute
%rpmattr %_libdir/%name/rpm[dikq]
%_libdir/%name/rpm[euv]
%rpmdatattr %_libdir/%name/rpmpopt*
%rpmdatattr %_libdir/%name/GROUPS
%_libdir/rpmpopt
%_libdir/rpmrc
%_man1dir/rpminit.*
%_man8dir/rpm.*
%_man8dir/rpm2cpio.*
%files build
%config %_sysconfdir/buildreqs/files/ignore.d/*
%rpmattr %_bindir/gendiff
%_bindir/rpmbuild
%_bindir/relative
%rpmdirattr %_libdir/%name
%_libdir/%name/rpmt
%rpmattr %_libdir/%name/rpmb
%rpmattr %_libdir/%name/filesize
%rpmattr %_libdir/%name/relative
%rpmattr %_libdir/%name/functions
%rpmattr %_libdir/%name/brp-*
%rpmattr %_libdir/%name/*_files
%rpmattr %_libdir/%name/check-files
%rpmattr %_libdir/%name/convertrpmrc.sh
%rpmattr %_libdir/%name/rpm2cpio.sh
%rpmattr %_libdir/%name/find-lang
%rpmattr %_libdir/%name/find-package
%rpmattr %_libdir/%name/find-provides
%rpmattr %_libdir/%name/find-requires
%rpmattr %_libdir/%name/fixup-*
%rpmattr %_libdir/%name/http.req
%rpmattr %_libdir/%name/files.*
%rpmattr %_libdir/%name/pam.*
%rpmattr %_libdir/%name/shell.*
%rpmattr %_libdir/%name/sql.*
%rpmattr %_libdir/%name/tcl.*
%rpmattr %_libdir/%name/verify-elf
%rpmattr %_libdir/%name/Specfile.pm
%_mandir/man?/gendiff.*
%_man8dir/rpmbuild.*
%if_with build_topdir
%files build-topdir
%attr(0755,root,%name) %dir %_usrsrc/RPM
%attr(0770,root,%name) %dir %_usrsrc/RPM/BUILD
%attr(2770,root,%name) %dir %_usrsrc/RPM/SPECS
%attr(2770,root,%name) %dir %_usrsrc/RPM/SOURCES
%attr(2775,root,%name) %dir %_usrsrc/RPM/SRPMS
%attr(0755,root,%name) %dir %_usrsrc/RPM/RPMS
%attr(2775,root,%name) %dir %_usrsrc/RPM/RPMS/*
%endif #with build_topdir
%if_with python
%files python
%_libdir/python*/site-packages/*module.so
%endif #with python
%files static
%_bindir/rpm.static
%if_with contrib
%files contrib
%rpmattr %dir %_libdir/%name
%rpmattr %_libdir/%name/cpanflute*
%rpmattr %_libdir/%name/cross-build
%rpmattr %_libdir/%name/find-prov.pl
%rpmattr %_libdir/%name/find-provides.perl
%rpmattr %_libdir/%name/find-req.pl
%rpmattr %_libdir/%name/find-requires.perl
%rpmattr %_libdir/%name/get_magic.pl
%rpmattr %_libdir/%name/getpo.sh
%rpmattr %_libdir/%name/javadeps
%rpmattr %_libdir/%name/magic.*
%rpmattr %_libdir/%name/rpmdiff*
%rpmattr %_libdir/%name/trpm
%rpmattr %_libdir/%name/u_pkg.sh
%rpmattr %_libdir/%name/vpkg-provides.sh
%rpmattr %_libdir/%name/vpkg-provides2.sh
%endif #with contrib
%changelog
…
Полный changelog можно просмотреть здесь