Browse files

Merge branch 'master' of github.com:sm/sm-tools

  • Loading branch information...
2 parents ad4b758 + cd7e6b6 commit 02b685dae3f5c1aa3a490dc47c1e7fa89874704f @wayneeseguin wayneeseguin committed Oct 6, 2011
Showing with 94 additions and 4 deletions.
  1. +4 −0 bzip2/CHANGELOG.md
  2. +4 −0 bzip2/README.md
  3. +3 −0 bzip2/TODO.md
  4. +1 −0 bzip2/VERSION
  5. +9 −0 bzip2/bin/help
  6. +3 −0 bzip2/config/defaults
  7. +1 −0 bzip2/config/md5
  8. +1 −0 bzip2/map
  9. +61 −0 bzip2/shell/functions
  10. +2 −0 bzip2/shell/includes
  11. +5 −4 unrar/shell/functions
View
4 bzip2/CHANGELOG.md
@@ -0,0 +1,4 @@
+# BDSM Extension Change Log
+
+* 0.0.1 - Initial Extension Release
+
View
4 bzip2/README.md
@@ -0,0 +1,4 @@
+# BDSM Extension README
+
+This extension installs the bzip2 package.
+
View
3 bzip2/TODO.md
@@ -0,0 +1,3 @@
+# BDSM Extension TODO List
+
+* TODO: Package and release the extension.
View
1 bzip2/VERSION
@@ -0,0 +1 @@
+0.0.1
View
9 bzip2/bin/help
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+description "${extension} BDSM extension."
+
+action "package install" "Installs ${package_name} ${package_version}."
+action "package uninstall" "Installs ${package_name} ${package_version}."
+
+show_help usage
+
View
3 bzip2/config/defaults
@@ -0,0 +1,3 @@
+version=1.0.6
+base_url=http://bzip.org/1.0.6
+website=http://bzip.org/
View
1 bzip2/config/md5
@@ -0,0 +1 @@
+bzip2-1.0.6.tar.gz=00b516f4704d4a7cb50a1d97e6e8e15b
View
1 bzip2/map
@@ -0,0 +1 @@
+
View
61 bzip2/shell/functions
@@ -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
2 bzip2/shell/includes
@@ -0,0 +1,2 @@
+api/package
+api/files
View
9 unrar/shell/functions
@@ -1,6 +1,6 @@
#!/bin/sh
-unrar_initialize()
+unrar_prefetch()
{
package define \
file "unrarsrc-${package_version}.${archive_format}" \
@@ -9,7 +9,8 @@ unrar_initialize()
unrar_configure()
{
- replace_content "^DESTDIR=.*$" \
+ file replace \
+ content "^DESTDIR=.*$" \
with "DESTDIR=${install_path}" \
in "makefile.unix"
}
@@ -31,7 +32,7 @@ unrar_build()
unrar_install()
{
paths create "${install_path}/bin"
- move_file "unrar" to "${install_path}/bin"
- ensure_files_are_executable "${install_path}/bin/unrar"
+ file move "unrar" to "${install_path}/bin"
+ file chmod 755 "${install_path}/bin/unrar"
}

0 comments on commit 02b685d

Please sign in to comment.