Permalink
Browse files

make bzip work

  • Loading branch information...
1 parent 236741c commit cd7e6b60544962e38b8e0d95d7c030a2bcf7031e @mpapis mpapis committed Sep 21, 2011
Showing with 62 additions and 0 deletions.
  1. +61 −0 bzip2/shell/functions
  2. +1 −0 bzip2/shell/includes
View
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+bzip2_configure()
+{
+ file replace \
+ regexp PREFIX=/usr/local \
+ string PREFIX=${install_path} \
+ in "${source_path}/${package_dir}/Makefile"
+
+ file replace \
+ regexp '$(CC) -shared ' \
+ string '$(CC) $(CFLAGS) -shared ' \
+ in "${source_path}/${package_dir}/Makefile-libbz2_so"
+
+ __sm.log.debug package "bzip2 does not need configure step ???"
+}
+
+bzip2_build()
+{
+ #Order is important to keep proper CFLAGS ...
+ bzip2_build_so
+ __sm.package.gnu.make
+}
+
+bzip2_build_so()
+{
+ typeset _command
+ _command="make -f Makefile-libbz2_so ${make_flags[@]:-"-j$(os cpu count)"}"
+ __sm.log.debug package "bzip_build_so: ${_command}"
+
+ export CFLAGS="${CFLAGS} -fpic -fPIC"
+ export PREFIX=${install_path}
+
+ ${=_command} > build_so.log 2>&1 ||
+ __sm.package.error \
+ "Compilation of ${package_name} ${package_version} failed! " "$PWD/build_so.log"
+}
+
+bzip2_install()
+{
+ bzip2_make_install
+ __sm.package.make.install
+}
+
+bzip2_make_install()
+{
+ trace_filter package || set -o xtrace
+ typeset _command
+ export PREFIX=${install_path}
+
+ __sm.log.step "${package_name} ${package_version} ~ install so"
+ (
+ mkdir -p ${PREFIX}/lib
+ cp -f libbz2.so.1.0.6 ${PREFIX}/lib/libbz2.so.1.0.6
+ chmod a+r ${PREFIX}/lib/libbz2.so.1.0.6
+ ) > make.install_so.log 2>&1 ||
+ __sm.package.error \
+ "Installation of lib${package_name}.so ${package_version} failed! " \
+ "$PWD/make.install_so.log"
+ __sm.log.step success
+}
View
@@ -1 +1,2 @@
api/package
+api/files

0 comments on commit cd7e6b6

Please sign in to comment.