add packaging
authorAnas Nashif <anas.nashif@intel.com>
Tue, 30 Oct 2012 20:42:10 +0000 (13:42 -0700)
committerAnas Nashif <anas.nashif@intel.com>
Tue, 30 Oct 2012 20:44:00 +0000 (13:44 -0700)
packaging/baselibs.conf [new file with mode: 0644]
packaging/bzip2.spec [new file with mode: 0644]
packaging/bznew.1.gz [new file with mode: 0644]
packaging/bznew.gz [new file with mode: 0644]
packaging/rpmlintrc [new file with mode: 0644]

diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf
new file mode 100644 (file)
index 0000000..8e55479
--- /dev/null
@@ -0,0 +1,6 @@
+libbz2
+  targetarch ia64 block!
+  provides "bzip2-<targettype> = <version>"
+  targettype x86 provides "baselibs-x86:<prefix>/usr/lib/libbz2.so.1"
+libbz2-devel
+  requires "libbz2-<targettype> = <version>"
diff --git a/packaging/bzip2.spec b/packaging/bzip2.spec
new file mode 100644 (file)
index 0000000..2eb42ea
--- /dev/null
@@ -0,0 +1,93 @@
+Name:           bzip2
+Version:        1.0.6
+Release:        0
+Provides:       bzip
+Obsoletes:      bzip
+BuildRequires:  libtool
+BuildRequires:  pkg-config
+Url:            http://www.bzip.org/
+Summary:        A Program for Compressing Files
+License:        BSD-3-Clause
+Group:          Productivity/Archiving/Compression
+Source:         bzip2-%{version}.tar.gz
+Source1:        bznew.gz
+Source2:        bznew.1.gz
+Source3:        baselibs.conf
+Source100:      rpmlintrc
+
+%description
+The bzip2 program is a very powerful program for compressing files.
+
+
+%package -n libbz2
+Summary:        The bzip2 runtime library
+Group:          Productivity/Archiving/Compression
+
+%description -n libbz2
+The bzip2 runtime library
+
+%package devel
+Summary:        The bzip2 runtime library development files
+Group:          Development/Libraries/Other
+Requires:       libbz2 = %{version} glibc-devel
+
+%description devel
+The bzip2 runtime library development files.
+
+%prep
+%setup -q
+
+%build
+profile_bzip2()
+{
+    tmpfile=$(mktemp)
+    trap "rm -f $tmpfile $tmpfile.bz2" EXIT
+    tar -cjf $tmpfile.bz2 /usr/src || true
+   # time ./bzip2 $tmpfile
+    time ./bzip2 -d < $tmpfile.bz2 > /dev/null
+}
+autoreconf -fiv
+%if %{do_profiling}
+export CFLAGS="$RPM_OPT_FLAGS %{cflags_profile_generate}"
+%endif
+%configure --with-pic --disable-static
+%if %{do_profiling}
+make %{?_smp_mflags}
+profile_bzip2
+mkdir .libs.save
+mv .libs/*.gcda .libs.save/
+make clean
+mv .libs.save .libs
+export CFLAGS="$RPM_OPT_FLAGS %{cflags_profile_feedback}"
+%configure --with-pic --disable-static
+%endif
+make %{?_smp_mflags}
+
+%install
+%make_install
+gzip -dc %{SOURCE1} > bznew
+install -D -m 755 bznew $RPM_BUILD_ROOT%{_bindir}/bznew
+install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man1
+
+%post -n libbz2 -p /sbin/ldconfig
+
+%postun -n libbz2  -p /sbin/ldconfig
+
+%docs_package
+
+%files
+%defattr(-,root,root)
+%{_bindir}/*
+
+%files -n libbz2
+%defattr(-,root,root)
+%{_libdir}/libbz2.so.1
+%{_libdir}/libbz2.so.1.*
+
+%files devel
+%doc LICENSE
+%{_includedir}/bzlib.h
+%{_libdir}/libbz2.so
+%{_libdir}/pkgconfig/bzip2.pc
+
+%changelog
diff --git a/packaging/bznew.1.gz b/packaging/bznew.1.gz
new file mode 100644 (file)
index 0000000..7a40492
Binary files /dev/null and b/packaging/bznew.1.gz differ
diff --git a/packaging/bznew.gz b/packaging/bznew.gz
new file mode 100644 (file)
index 0000000..bb12f4a
Binary files /dev/null and b/packaging/bznew.gz differ
diff --git a/packaging/rpmlintrc b/packaging/rpmlintrc
new file mode 100644 (file)
index 0000000..a8e9080
--- /dev/null
@@ -0,0 +1,4 @@
+# This line is mandatory to access the configuration functions
+from Config import *
+
+addFilter("bzip2 explicit-lib-dependency libbz2-1")