Commit 94572488 authored by dcoutadeur dcoutadeur's avatar dcoutadeur dcoutadeur

update SLES packaging script to include src packages + README to describe signature process


git-svn-id: svn://svn.forge.objectweb.org/svnroot/lemonldap/branches/lemonldap-ng_version_1_4-bugfixes@4956 1dbb9719-a921-0410-b57f-c3a383c2c641
parent be5ed1fe
......@@ -52,3 +52,47 @@ Last target is optional:
(it allows to create a repository with the desired packages
Signature
----------------------------------
There are two options:
- sign RPM packages
- sign repository
Sign the repository is not so useful, so this procedure only take care
about RPM signature.
Generate gpg key:
pgp -kg
Set RPM macro for choosing correct key:
echo '%_signature gpg
%_gpg_name KEY_NAME' > ~/.rpmmacros
Sign the packages:
rpm --resign lemonldap-sles12-repository/noarch/*.rpm \
lemonldap-sles12-repository/src/*.rpm \
lemonldap-sles12-repository/x86_64/*.rpm
Signature generates different files. It is recommended to
resign only new packages. Then the checksum must be
calculated again:
createrepo --update lemonldap-sles12-repository
You can also configure a .repo descriptor for better integration:
echo '[lemonldap-sles12-repository-signed]
name=lemonldap-sles12-repository
type=rpm-md
baseurl=http://host.tld/lemonldap-sles12-repository
gpgcheck=1
gpgkey=http://host.tld/lemonldap-sles12-repository/repodata/repomd.xml.key
enabled=1' > lemonldap-sles12-repository/lemonldap-sles12-repository.repo
With this .repo file, you need to export the GPG key with:
gpg --armor --export KEY_NAME > lemonldap-sles12-repository/repodata/repomd.xml.key
With this .repo file, the repository can be added with:
zypper addrepo http://host.tld/lemonldap-sles12-repository/lemonldap-sles12-repository.repo
On the client side, the GPG key can be imported with:
rpm --import http://host.tld/lemonldap-sles12-repository/repodata/repomd.xml.key
......@@ -324,6 +324,11 @@ build_dependencies_packages()
PKG_PATH=$( find /usr/src/packages/RPMS -name "${COMPLETE_PACKAGE_NAME}*.rpm" )
cp ${PKG_PATH} ~/packages/dependencies/additional/
# gather src packages
mkdir -p ~/packages/dependencies/additional-src
SPKG_PATH=$( find /usr/src/packages/SRPMS -name "${COMPLETE_PACKAGE_NAME}*.src.rpm" )
cp ${SPKG_PATH} ~/packages/dependencies/additional-src/
# install package
if zypper search ${COMPLETE_PACKAGE_NAME} | grep -E "\b${COMPLETE_PACKAGE_NAME}\b" | grep -E '^i' -q ; then
echo "OK: package already installed"
......@@ -395,6 +400,10 @@ build_lemonldap_package()
mkdir -p ~/packages/lemonldap
cp /usr/src/packages/RPMS/*/lemonldap*.rpm ~/packages/lemonldap/
cp /usr/src/packages/RPMS/*/perl-Lemonldap*.rpm ~/packages/lemonldap/
# gather src packages
mkdir -p ~/packages/lemonldap-src
cp /usr/src/packages/SRPMS/lemonldap-ng*.src.rpm ~/packages/lemonldap-src/
}
......@@ -408,17 +417,43 @@ build_repository()
echo "The repository already exists"
echo "Just update with new files "
# move only new dependency packages to repository
for f in ~/packages/dependencies/additional/*; do
if [ ! -e $LREPO/${f##*/} ]; then
cp ~/packages/dependencies/additional/${f##*/} $LREPO/
# create sub-directories anyway
mkdir -p $LREPO/noarch
mkdir -p $LREPO/x86_64
mkdir -p $LREPO/src
# move only new noarch dependency packages to repository
for f in ~/packages/dependencies/additional/*.noarch.rpm; do
if [ ! -e $LREPO/noarch/${f##*/} ]; then
cp ~/packages/dependencies/additional/${f##*/} $LREPO/noarch
fi
done
# move only new x86_64 dependency packages to repository
for f in ~/packages/dependencies/additional/*.x86_64.rpm; do
if [ ! -e $LREPO/noarch/${f##*/} ]; then
cp ~/packages/dependencies/additional/${f##*/} $LREPO/x86_64
fi
done
# move only new lemonldap packages to repository
for f in ~/packages/lemonldap/*; do
if [ ! -e $LREPO/${f##*/} ]; then
cp ~/packages/lemonldap/${f##*/} $LREPO/
if [ ! -e $LREPO/noarch/${f##*/} ]; then
cp ~/packages/lemonldap/${f##*/} $LREPO/noarch
fi
done
# move only new src dependency packages to repository
for f in ~/packages/dependencies/additional-src/*; do
if [ ! -e $LREPO/src/${f##*/} ]; then
cp ~/packages/dependencies/additional-src/${f##*/} $LREPO/src
fi
done
# move only new src lemonldap packages to repository
for f in ~/packages/lemonldap-src/*; do
if [ ! -e $LREPO/src/${f##*/} ]; then
cp ~/packages/lemonldap-src/${f##*/} $LREPO/src
fi
done
......@@ -429,10 +464,16 @@ build_repository()
# Repository does not already exist
echo "Repository does not already exist"
echo "Create new one"
mkdir -p $LREPO
cp ~/packages/dependencies/additional/* $LREPO/
cp ~/packages/lemonldap/* $LREPO/
# create sub-directories
mkdir -p $LREPO/noarch
mkdir -p $LREPO/x86_64
mkdir -p $LREPO/src
cp ~/packages/dependencies/additional/*.noarch.rpm $LREPO/noarch
cp ~/packages/dependencies/additional/*.x86_64.rpm $LREPO/x86_64
cp ~/packages/lemonldap/* $LREPO/noarch
cp ~/packages/dependencies/additional-src/* $LREPO/src
cp ~/packages/lemonldap-src/* $LREPO/src
# create repository
createrepo ~/$LREPO
......@@ -474,7 +515,7 @@ hook-digest-sha()
print_help()
{
echo "USAGE:"
echo "$0 [pre] [iba] [ibu] [bde] [ble] [help]"
echo "$0 [pre] [iba] [ibu] [bde] [ble] [bre] [help]"
echo "[pre] - install PRErequisites"
echo "[iba] - Install BAsic dependencies"
echo "[ibu] - Install BUild dependencies"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment