2006-10-28 11:52:49 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
# This script documents how this cdrskin version was derived from
|
|
|
|
# a vanilla libburn version. It is not intended nor needed for any
|
|
|
|
# use of cdrskin but included here only to show the technical
|
|
|
|
# relationship between both projects - which are close friends
|
|
|
|
# and issue roughly the same software.
|
|
|
|
#
|
|
|
|
# Package maintainers are advised to cover rather libburn than
|
|
|
|
# cdrskin unless they put only emphasis on the cdrecord emulation
|
|
|
|
# provided by cdrskin. libburn contains cdrskin - cdrskin is an
|
|
|
|
# oscillating, friendly and coordinated fork of libburn.
|
|
|
|
#
|
|
|
|
# Script results are a source tarball and two binaries
|
|
|
|
# one dynamic and one static in respect to system libs.
|
|
|
|
# Both binaries are static in respect to libburn.
|
|
|
|
#
|
|
|
|
# The script is to be run in the directory above the toplevel
|
|
|
|
# directory of libburn resp. cdrskin development.
|
|
|
|
#
|
2007-02-10 17:15:12 +00:00
|
|
|
|
|
|
|
# The top level directory in the SVN snapshot is named
|
|
|
|
intermediate="./libburn_pykix"
|
|
|
|
|
2007-10-29 16:47:49 +00:00
|
|
|
# libburn source used: http://libburnia.pykix.org
|
2006-10-28 11:52:49 +00:00
|
|
|
# Downloaded by:
|
2007-10-29 16:47:49 +00:00
|
|
|
# $ svn co http://libburnia-svn.pykix.org/libburn/tags/... $intermediate
|
2006-10-28 11:52:49 +00:00
|
|
|
# packed up in a tarball just to save it from inadverted changes by
|
2007-02-10 17:15:12 +00:00
|
|
|
# $ tar czf libburn_svn.tgz $intermediate
|
2007-10-29 16:47:49 +00:00
|
|
|
original="./libburn_svn_release.tgz"
|
2006-10-28 11:52:49 +00:00
|
|
|
# Historic moments:
|
|
|
|
# original="./libburn_svn_A60815.tgz"
|
|
|
|
# original="./libburn_cdrskin_A60819.tgz"
|
|
|
|
|
|
|
|
|
2007-02-10 17:15:12 +00:00
|
|
|
# My changes are in $changes , mainly in $changes/cdrskin
|
2007-10-29 16:47:49 +00:00
|
|
|
changes="./libburn-release"
|
2007-02-10 17:15:12 +00:00
|
|
|
|
2012-07-20 11:49:52 +00:00
|
|
|
skin_release="1.2.4"
|
2011-06-18 15:58:14 +00:00
|
|
|
patch_level=""
|
|
|
|
# patch_level=".pl00"
|
2007-01-16 15:07:09 +00:00
|
|
|
skin_rev="$skin_release""$patch_level"
|
2006-10-28 11:52:49 +00:00
|
|
|
|
|
|
|
# The result directory and the name of the result tarballs
|
2007-01-16 15:07:09 +00:00
|
|
|
target="./cdrskin-${skin_release}"
|
2006-10-28 11:52:49 +00:00
|
|
|
cdrskin_tarball="./cdrskin-${skin_rev}.tar.gz"
|
|
|
|
cdrskin_tarball_svn="./cdrskin-${skin_rev}.svn.tar.gz"
|
|
|
|
|
|
|
|
# (This once earned me an embarrassingly blooping source tarball)
|
|
|
|
# compile_dir="$changes"
|
|
|
|
|
|
|
|
compile_dir="$target"
|
|
|
|
compile_cmd="./cdrskin/compile_cdrskin.sh"
|
|
|
|
compile_static_opts="-static"
|
|
|
|
compile_result="cdrskin/cdrskin"
|
|
|
|
|
2006-12-14 10:29:03 +00:00
|
|
|
man_to_html_cmd="./cdrskin/convert_man_to_html.sh"
|
|
|
|
man_page_html="cdrskin/man_1_cdrskin.html"
|
|
|
|
|
2008-01-27 15:18:12 +00:00
|
|
|
# bintarget_dynamic="cdrskin_${skin_rev}-x86-suse9_0"
|
|
|
|
bintarget_dynamic="cdrskin_${skin_rev}-amd64-suse10_2"
|
2006-10-28 11:52:49 +00:00
|
|
|
bintarget_static="$bintarget_dynamic"-static
|
|
|
|
|
|
|
|
if test -d "$changes"
|
|
|
|
then
|
|
|
|
dummy=dummy
|
|
|
|
else
|
|
|
|
echo "$0 : FATAL : no directory $changes" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
for i in "$target" "$intermediate"
|
|
|
|
do
|
|
|
|
if test -e "$i"
|
|
|
|
then
|
|
|
|
echo "$0 : FATAL : already existing $i" >&2
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if test -f "$original"
|
|
|
|
then
|
|
|
|
dummy=dummy
|
|
|
|
else
|
|
|
|
echo "$0 : FATAL : no file $original" >&2
|
|
|
|
exit 3
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Unpack SVN snapshot.
|
|
|
|
tar xzf "$original"
|
|
|
|
|
|
|
|
|
|
|
|
# Rename the directory to the cdrskin name
|
|
|
|
mv "$intermediate" "$target"
|
|
|
|
|
|
|
|
|
|
|
|
# Copy the changes from the development tree
|
|
|
|
#
|
|
|
|
cdrskin_dir="$changes"/cdrskin
|
|
|
|
libburn_dir="$changes"/libburn
|
|
|
|
cdrskin_target="$target"/cdrskin
|
|
|
|
libburn_target="$target"/libburn
|
|
|
|
|
|
|
|
# Create version timestamp
|
2008-05-10 13:41:58 +00:00
|
|
|
# timestamp="$(date -u '+%Y.%m.%d.%H%M%S')"
|
|
|
|
# echo "$timestamp"
|
|
|
|
# echo '#define Cdrskin_timestamP "'"$timestamp"'"' >"$cdrskin_dir"/cdrskin_timestamp.h
|
2006-10-28 11:52:49 +00:00
|
|
|
|
|
|
|
# Add the cdrskin files
|
|
|
|
if test -e "$cdrskin_target"
|
|
|
|
then
|
|
|
|
rm -rf "$cdrskin_target"
|
|
|
|
fi
|
|
|
|
cp -a "$cdrskin_dir" "$cdrskin_target"
|
|
|
|
|
2007-04-23 15:48:40 +00:00
|
|
|
# Remove copied vim.swp and binaries
|
|
|
|
rm "$cdrskin_target"/.*.swp
|
2009-08-27 14:39:33 +00:00
|
|
|
rm "$cdrskin_target"/.*.swo
|
2006-10-28 11:52:49 +00:00
|
|
|
rm "$cdrskin_target"/*.o
|
|
|
|
rm "$cdrskin_target"/cdrfifo
|
|
|
|
rm "$cdrskin_target"/cdrskin
|
|
|
|
rm "$cdrskin_target"/cleanup
|
|
|
|
for i in std new make old
|
|
|
|
do
|
|
|
|
if test -e "$cdrskin_target"/cdrskin_"$i"
|
|
|
|
then
|
|
|
|
rm "$cdrskin_target"/cdrskin_"$i"
|
|
|
|
fi
|
|
|
|
done
|
2006-12-14 10:29:03 +00:00
|
|
|
|
2007-01-16 15:07:09 +00:00
|
|
|
# Remove eventual SVN stuff from cdrskin directory
|
2006-10-28 11:52:49 +00:00
|
|
|
for i in .deps .dirstamp .libs
|
|
|
|
do
|
|
|
|
if test -e "$cdrskin_target"/"$i"
|
|
|
|
then
|
|
|
|
rm -rf "$cdrskin_target"/"$i"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2006-12-03 20:52:43 +00:00
|
|
|
# Remove GIFs of cdrskin_eng.html
|
2007-06-08 10:49:17 +00:00
|
|
|
rm "$cdrskin_target"/doener_*.gif "$cdrskin_target"/doener_*.png
|
2006-12-03 20:52:43 +00:00
|
|
|
|
2007-01-16 15:07:09 +00:00
|
|
|
# Remove automatically generated HTML man page
|
|
|
|
rm "$cdrskin_target"/man_1_cdrskin.html
|
|
|
|
|
|
|
|
# Remove all add_ts_changes_to_libburn besides this one
|
|
|
|
for i in "$cdrskin_target"/add_ts_changes_to_libburn*
|
|
|
|
do
|
|
|
|
if test $(basename "$0") = $(basename "$i")
|
|
|
|
then
|
|
|
|
dummy=dummy
|
|
|
|
else
|
|
|
|
rm $i
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2007-10-29 16:47:49 +00:00
|
|
|
# Remove libcevap
|
|
|
|
rm -rf "$target"/libcevap
|
|
|
|
|
|
|
|
|
2006-10-28 11:52:49 +00:00
|
|
|
# Remove unwanted SVN stuff (TODO: avoid downloading it)
|
|
|
|
for i in "$target"/.svn "$target"/*/.svn
|
|
|
|
do
|
|
|
|
if test "$i" = "$target"'/*/.svn'
|
|
|
|
then
|
|
|
|
dummy=dummy
|
|
|
|
else
|
|
|
|
if test -e "$i"
|
|
|
|
then
|
|
|
|
rm -rf "$i"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
# Make SVN state tarball for the libburn team
|
|
|
|
tar czf "$cdrskin_tarball_svn" "$target"
|
|
|
|
|
|
|
|
|
|
|
|
# Get over dependecy on autotools. Rely only on cc, make et. al.
|
|
|
|
# This is not the same as "make dist" but i can do it without
|
|
|
|
# having to evaluate the quality of said "make dist"
|
|
|
|
#
|
|
|
|
( cd "$target" ; ./bootstrap )
|
|
|
|
|
|
|
|
# Remove unwanted stuff after bootstrap
|
|
|
|
for i in "$target"/autom4te.cache
|
|
|
|
do
|
|
|
|
if echo "$i" | grep '\*' >/dev/null
|
|
|
|
then
|
|
|
|
dummy=dummy
|
|
|
|
else
|
|
|
|
if test -e "$i"
|
|
|
|
then
|
|
|
|
rm -rf "$i"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2007-04-22 12:20:33 +00:00
|
|
|
# Repair non-portable shell code output of ./bootstrap
|
2007-10-29 16:47:49 +00:00
|
|
|
(
|
2007-04-22 12:20:33 +00:00
|
|
|
cd "$compile_dir" || exit 1
|
|
|
|
sed -e 's/^for ac_header in$/test -z 1 \&\& for ac_header in dummy/' \
|
|
|
|
< ./configure > ./configure-repaired
|
|
|
|
if test "$?" = 0
|
|
|
|
then
|
|
|
|
echo "$0: Empty 'for ac_header in' found in configure." >&2
|
|
|
|
fi
|
|
|
|
mv ./configure-repaired ./configure
|
|
|
|
chmod a+rx,go-w,u+w ./configure
|
|
|
|
)
|
|
|
|
|
2006-10-28 11:52:49 +00:00
|
|
|
# Pack it up to the new libburn+cdrskin-tarball
|
|
|
|
tar czf "$cdrskin_tarball" "$target"
|
|
|
|
|
2006-12-14 10:29:03 +00:00
|
|
|
# Produce a static and a dynamic binary, and a HTML man page
|
2006-10-28 11:52:49 +00:00
|
|
|
(
|
|
|
|
cd "$compile_dir" || exit 1
|
|
|
|
./configure
|
|
|
|
make
|
2007-10-29 16:47:49 +00:00
|
|
|
"$compile_cmd" -O2 -do_strip
|
2006-10-28 11:52:49 +00:00
|
|
|
cp "$compile_result" "../$bintarget_dynamic"
|
|
|
|
if test -n "$compile_static_opts"
|
|
|
|
then
|
2007-10-29 16:47:49 +00:00
|
|
|
"$compile_cmd" $compile_static_opts -O2 -do_strip
|
2006-10-28 11:52:49 +00:00
|
|
|
cp "$compile_result" "../$bintarget_static"
|
|
|
|
fi
|
2006-12-14 10:29:03 +00:00
|
|
|
"$man_to_html_cmd"
|
|
|
|
mv "$man_page_html" ..
|
2006-10-28 11:52:49 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Remove the build area
|
|
|
|
# Disable this for debugging the merge process
|
|
|
|
rm -rf "$target"
|
|
|
|
|
|
|
|
# Show the result
|
|
|
|
./"$bintarget_dynamic" -version
|
|
|
|
./"$bintarget_static" -version
|
|
|
|
ls -l "$cdrskin_tarball"
|
2007-10-29 16:47:49 +00:00
|
|
|
ls -l "$bintarget_dynamic"
|
2006-10-28 11:52:49 +00:00
|
|
|
ls -l "$bintarget_static"
|
2006-12-14 10:29:03 +00:00
|
|
|
ls -l $(basename "$man_page_html")
|
2006-10-28 11:52:49 +00:00
|
|
|
|