From 7aa477dcded541c284e09e90b89c45fa95c9adb4 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sat, 23 Jan 2016 12:20:05 +0000 Subject: [PATCH] make, scripts: Add .pc to rpm packages Next attempt on creating rpm with .pc file inside. Signed-off-by: Jan Lindemann --- make/mkspec.sh | 71 ---------------------------------------- scripts/create-mkspec.sh | 5 +-- scripts/pkg.sh | 7 ++-- 3 files changed, 5 insertions(+), 78 deletions(-) delete mode 100644 make/mkspec.sh diff --git a/make/mkspec.sh b/make/mkspec.sh deleted file mode 100644 index eb4178f9..00000000 --- a/make/mkspec.sh +++ /dev/null @@ -1,71 +0,0 @@ -echo "Name: $NAME" -echo "Summary: Jannet IT Services Tool Library" -echo "Version: $VERSION" -echo "Release: $RELEASE" -echo "License: LGPL" -echo "Group: System Environment/Libraries" -[ -n "$SOURCE" ] && echo "Source: $SOURCE" -echo "Vendor: Jannet IT Services" -echo "URL: http://www.jannet.de" -echo "BuildRoot: /var/tmp/%{name}-buildroot" -echo "" -echo "%description" -echo "This is a library providing easy-to-use interfaces for:" -echo "" -echo "+ platform independent logging" -echo "+ platform independent locking" -echo "+ platform independent threads" -echo "+ platform independent profiling" -echo "+ a platform independent config file reader" -echo "+ shared memory" -echo "+ a lightweight middleware suite" -echo "" -echo "It was originally designed to be a versatile pool of" -echo "programming tools to be used in my projects as a freelancing" -echo "software developer." -echo "" -echo "%package -n $NAME-run" -echo "Summary: The runtime library package." -echo "Group: System Environment/Libraries" -echo "Provides: $NAME = $VERSION" -echo "%description -n $NAME-run" -echo "runtime library package of the ytools library" -echo "" -echo "%package -n $NAME-devel" -echo "Summary: The development library package." -echo "Group: System Environment/Libraries" -if [ -n "$REQUIRES_DEVEL" ]; then echo "Requires: $REQUIRES_DEVEL"; fi -echo "%description -n $NAME-devel" -echo "development library package of the ytools library" -echo "" -#echo "%debug_package" -echo "%prep" -echo "%setup -q -n $NAME-$V" -echo "" -echo "%build" -echo 'pwd' -echo 'make config' -echo 'make' -echo "" -echo "%install" -echo "export ENV_PREFIX=\$RPM_BUILD_ROOT/" -echo "export INSTALL_LOG=$INSTALL_LOG" -echo "rm -rf `dirname $INSTALL_LOG`" -echo "mkdir -p `dirname $INSTALL_LOG`" -echo "> $INSTALL_LOG" -echo "make install" -echo "cat $INSTALL_LOG | sed \"s% \$RPM_BUILD_ROOT% %\" | grep -ve '"$FILTER_DEVEL"' > $INSTALL_LOG-run" -echo "cat $INSTALL_LOG | sed \"s% \$RPM_BUILD_ROOT% %\" | grep -e '"$FILTER_DEVEL"' > $INSTALL_LOG-devel" -echo "" -echo "%post -n $NAME-run" -if [ "$TARGET" != mingw ]; then - echo "/opt/ytools/bin/jcs init" - echo "if [ -x /sbin/mkinitrd_setup ]; then /sbin/mkinitrd_setup; fi" -fi -echo "" -echo "%clean" -echo "%files -n $NAME-run -f $INSTALL_LOG-run" -echo "%files -n $NAME-devel -f $INSTALL_LOG-devel" -echo '%defattr (-, root, root)' -echo "" - diff --git a/scripts/create-mkspec.sh b/scripts/create-mkspec.sh index 0e53bb39..3d13d8b4 100644 --- a/scripts/create-mkspec.sh +++ b/scripts/create-mkspec.sh @@ -65,10 +65,7 @@ _cat << EOT |echo "mkdir -p \`dirname \$INSTALL_LOG\`" |echo "> \$INSTALL_LOG" |echo "make install" - |echo "cat \$INSTALL_LOG | sed \"s% \\\$RPM_BUILD_ROOT% %\" | " - |echo " grep -ve '/include/\|devel\|/lib.*\.a\$\|/make\(/\|$\)' | sort -u > \$INSTALL_LOG.\$NAME-run" - |echo "cat \$INSTALL_LOG | sed \"s% \\\$RPM_BUILD_ROOT% %\" | " - |echo " grep -e '/include/\|devel\|/lib.*\.a\$\|/make\(/\|$\)' | sort -u > \$INSTALL_LOG.\$NAME-devel" + |echo "/bin/bash ./devutil/scripts/pkg.sh milk-install-log -p \\\$ENV_PREFIX -n \$NAME -t rpm \$INSTALL_LOG \`dirname \$INSTALL_LOG\`" |echo "" EOT ini_value global.subpackages | grep -q run && _cat << EOT diff --git a/scripts/pkg.sh b/scripts/pkg.sh index 4d960f8c..df809e99 100644 --- a/scripts/pkg.sh +++ b/scripts/pkg.sh @@ -755,6 +755,7 @@ cmd_milk_install_log() milk_install_log_usage() { echo "usage: $myname [-h] [-n pkg-name] [-t rpm|deb] [-p remove-prefix] install-log output-dir" + [ "$1" ] && exit $1 } milk_install_log_spec_attr() @@ -799,13 +800,13 @@ cmd_milk_install_log() in=$1 out=$2 - local filter_devel='/include/.*.h$\|devel\|make\|lib.*\.a$\|lib.*\.so$\|.*\.exp$\|.*\.def$\|.*\.lib$\|\.pc$' + local filter_devel='/include/.*.h$\|devel\|make\|lib.*\.a$\|lib.*\.so$\|.*\.exp$\|.*\.def$\|.*\.lib$\|.*\.pc$' # TODO: simplify this case $type in rpm) - cat $in | sed "s% $prefix% %//" | grep -ve $filter_devel > $out/files-$name-run - cat $in | sed "s% $prefix% %//" | grep -e $filter_devel > $out/files-$name-devel + cat $in | sed "s% $prefix% %" | grep -ve $filter_devel > $in.$name-run + cat $in | sed "s% $prefix% %" | grep -e $filter_devel > $in.$name-devel ;; deb) cat $in | grep -v "%dir" | sed "s% $prefix% %; s%//*%/%g; s/.*) *//" | grep -ve $filter_devel | sed 's/\(.*\)\/\([^/]\+\) *$/inst-root\1\/\2 \1/' > $out/$name-run.install