forked from pool/fakeroot
Marcus Meissner
b1405cb655
OBS-URL: https://build.opensuse.org/package/show/devel:tools/fakeroot?expand=0&rev=2
97 lines
3.0 KiB
RPMSpec
97 lines
3.0 KiB
RPMSpec
# norootforbuild
|
|
Name: fakeroot
|
|
Group: Development/Languages
|
|
Version: 1.9.3
|
|
Release: 1
|
|
License: UNKNOWN
|
|
Summary: Gives a fake root environment
|
|
Autoreqprov: on
|
|
Source0: fakeroot-1.9.3.tar.bz2
|
|
BuildRoot:%{_tmppath}/%{name}-%{version}-build
|
|
# build essentials
|
|
BuildRequires: sharutils
|
|
BuildRequires: libacl-devel
|
|
BuildRequires: glibc-devel
|
|
|
|
%description
|
|
fakeroot runs a command in an environment were it appears to have root
|
|
privileges for file manipulation. This is useful for allowing users to
|
|
create archives (tar, ar, .deb etc.) with files in them with root
|
|
permissions/ownership. Without fakeroot one would have to have root
|
|
privileges to create the constituent files of the archives with the
|
|
correct permissions and ownership, and then pack them up, or one would
|
|
have to construct the archives directly, without using the archiver.
|
|
|
|
fakeroot works by replacing the file manipulation library functions
|
|
(chmod(), stat() etc.) by ones that simulate the effect the real
|
|
library functions would have had, had the user really been root. These
|
|
wrapper functions are in a shared library libfakeroot.so*, which is
|
|
loaded through the LD_PRELOAD mechanism of the dynamic loader.
|
|
|
|
This package is intended to enable something like:
|
|
dpkg-buildpackage -rfakeroot
|
|
i.e. to remove the need to become root for a package build.
|
|
This is done by setting LD_PRELOAD to libfakeroot.so,
|
|
which provides wrappers around getuid, chown, chmod, mknod,
|
|
stat, and so on, thereby creating a fake root environment.
|
|
|
|
fakeroot requires SYSV IPC or TCP to operate.
|
|
|
|
%prep
|
|
%setup -q -n %{name}-%{version}
|
|
|
|
%build
|
|
unset POSIXLY_CORRECT
|
|
mkdir obj-sysv obj-tcp
|
|
(
|
|
cd obj-sysv
|
|
CFLAGS="$RPM_OPT_FLAGS" ../configure --prefix=/usr --mandir=/usr/share/man \
|
|
--libdir=/usr/lib --program-suffix=-sysv --disable-static
|
|
make
|
|
)
|
|
(
|
|
cd obj-tcp
|
|
CFLAGS="$RPM_OPT_FLAGS" ../configure --prefix=/usr \
|
|
--mandir=/usr/share/man --libdir=/usr/lib --with-ipc=tcp \
|
|
--program-suffix=-tcp --disable-static
|
|
make
|
|
)
|
|
|
|
%install
|
|
unset POSIXLY_CORRECT
|
|
make -C obj-tcp DESTDIR="$RPM_BUILD_ROOT" install
|
|
mv $RPM_BUILD_ROOT/usr/lib/libfakeroot-0.so \
|
|
$RPM_BUILD_ROOT/usr/lib/libfakeroot-tcp.so
|
|
make -C obj-sysv DESTDIR="$RPM_BUILD_ROOT" install
|
|
mv $RPM_BUILD_ROOT/usr/lib/libfakeroot-0.so \
|
|
$RPM_BUILD_ROOT/usr/lib/libfakeroot-sysv.so
|
|
ln -fs /usr/bin/fakeroot-sysv $RPM_BUILD_ROOT/usr/bin/fakeroot
|
|
ln -fs /usr/bin/faked $RPM_BUILD_ROOT/usr/bin/faked
|
|
|
|
# cleanup
|
|
rm $RPM_BUILD_ROOT/usr/lib/libfakeroot.*a
|
|
rm $RPM_BUILD_ROOT/usr/lib/libfakeroot.so
|
|
rm -fr $RPM_BUILD_ROOT/%{_mandir}/es
|
|
rm -fr $RPM_BUILD_ROOT/%{_mandir}/fr
|
|
rm -fr $RPM_BUILD_ROOT/%{_mandir}/sv
|
|
rm -fr $RPM_BUILD_ROOT/%{_mandir}/nl
|
|
gzip -9 $RPM_BUILD_ROOT/%{_mandir}/man?/*.?
|
|
|
|
%files -n fakeroot
|
|
%defattr(-,root,root)
|
|
/usr/bin/faked
|
|
/usr/bin/fakeroot
|
|
/usr/bin/faked-sysv
|
|
/usr/bin/faked-tcp
|
|
/usr/bin/fakeroot-sysv
|
|
/usr/bin/fakeroot-tcp
|
|
%_libdir/libfakeroot-sysv.so
|
|
%_libdir/libfakeroot-tcp.so
|
|
%doc AUTHORS BUGS COPYING DEBUG INSTALL README
|
|
%doc %{_mandir}/man?/*
|
|
|
|
%clean
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
%changelog
|