[packages/libpagespeed] clean source from bundled libs leaving gyp and .h around
glen
glen at pld-linux.org
Fri Mar 8 02:09:59 CET 2013
commit f44e6e3d41d47142be1e80a07867de1fb3e161f6
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Fri Mar 8 03:09:08 2013 +0200
clean source from bundled libs leaving gyp and .h around
clean-source.sh | 36 ++++++++++++++++++++++++++++++++++++
libpagespeed.spec | 7 ++++++-
2 files changed, 42 insertions(+), 1 deletion(-)
---
diff --git a/libpagespeed.spec b/libpagespeed.spec
index 3aa7251..7f26313 100644
--- a/libpagespeed.spec
+++ b/libpagespeed.spec
@@ -19,13 +19,14 @@
Summary: Page Speed native libraries
Name: libpagespeed
Version: 1.12.16.0
-Release: 0.4
+Release: 0.5
License: Apache v2.0
Group: Libraries
Source0: %{name}-%{version}.tar.xz
# Source0-md5: 8558c2b583e5858360846299284eb231
Source1: get-source.sh
Source2: gclient.conf
+Source3: clean-source.sh
Patch0: system-libs.patch
URL: https://code.google.com/p/page-speed/
BuildRequires: gperf
@@ -44,6 +45,10 @@ Page Speed rule logic.
%setup -q
%patch0 -p1
+ln -s %{SOURCE3} .
+
+sh -x clean-source.sh
+
%build
test %{_specdir}/%{name}.spec -nt Makefile && %{__rm} -f Makefile
test -e Makefile || \
diff --git a/clean-source.sh b/clean-source.sh
new file mode 100755
index 0000000..e0e3024
--- /dev/null
+++ b/clean-source.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+set -xe
+
+export LC_ALL=C
+
+# import options
+# remove everything unless it's remove has been disabled with "0"
+# "v8=0" means "do not remove v8"
+eval "$@"
+
+# removes dir, if the bcond is not turned off
+# .gyp and .gypi is always preserved, and foo.h in that dir
+strip_system_dirs() {
+ local dir lib bcond
+ for dir in "$@"; do
+ lib=${dir##*/}
+ bcond=$(eval echo \$$lib)
+ [ "${bcond:-1}" = 0 ] && continue
+
+ # skip already removed dirs
+ test -d $dir || continue
+
+ find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' -o -path $dir/$lib.h ')' -print -delete
+ done
+}
+
+strip_system_dirs \
+ third_party/zlib \
+> REMOVED-system_dirs.txt
+
+find -type d '!' -name '.' -print0 | sort -zr | xargs -0 rmdir --ignore-fail-on-non-empty > REMOVED-dirs.txt
+
+# report what's in them
+for a in REMOVED-*.txt; do
+ cat $a
+done
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/libpagespeed.git/commitdiff/f44e6e3d41d47142be1e80a07867de1fb3e161f6
More information about the pld-cvs-commit
mailing list