To create RPM building environment:
- create ~/.rpmmacros with the following content:
%_topdir .../rpm #Arbitrary
%_tmppath /tmp/rpm #Optional
Three dots here denote your favorite RPM building directory infrastructure root. (/home/username will do) - use the following script:
#!/bin/sh
for d in _topdir _sourcedir _rpmdir _srcrpmdir _specdir _builddir _tmppath; do
mkdir -p `rpm --eval %{$d}`
done
In your RPM generation script use constructions like
# Doesn't override previously set value. See Parameter Expansion
SOURCES=${SOURCES:-`rpm --eval %{_sourcedir}`}
#Assumes your sources are in $PROJECTS/$PROJECT directory
tar --wildcards --exclude \*\.svn\* --exclude \*\~ \ -C "$PROJECTS" -zcf "$SOURCES/$PROJECT.tar.gz" $PROJECT
rpmbuild -ba "$PROJECTS/$PROJECT/$PROJECT.spec"
Following this recommendation you will never need to force your packagers to use a harcoded SOURCES folder or to do configuration of your package with their RPM settings.
Комментариев нет:
Отправить комментарий