legacy/libisoburn/trunk/xorriso/make_xorriso_standalone.sh

350 lines
8.0 KiB
Bash
Raw Normal View History

#!/bin/sh
2008-02-15 21:19:24 +00:00
# make_xorriso_standalone.sh
# Copyright 2008 - 2010 Thomas Schmitt, scdbackup@gmx.net, GPLv2+
#
2008-02-15 21:19:24 +00:00
# Not intended for general use in production installations !
#
# This is a development tool which expects a special setup of directories.
# It is to be executed in a common parent of the directories
# nglibisofs-develop libburn-develop libisoburn-develop
# where tarballs or repository copies have been installed of
# libisofs libburn libisoburn
2010-05-04 12:06:51 +00:00
# obtained according to instructions on http://libburnia-project.org.
2008-02-15 21:19:24 +00:00
#
# It creates a new directory tree
# xorriso-standalone
# for building GNU xorriso.
2008-02-15 21:19:24 +00:00
#
# The ./bootstrap script gets applied and a source tarball
# is made.
#
# From that tree can be build a binary xorriso/xorriso which at runtime
# does not depend on installed libburnia libraries.
# Execute in xorriso-standalone :
#
# ./configure && make
#
# By the variable setting create_gnu_xorriso="yes"
# the result will become a GNU xorriso tarball under GPLv3+.
# Without this setting, the result is technically equivalent but
# stays under GPLv2+. In that case the files xorriso/*_gnu_xorriso
# are merely informative.
# Note that it is not permissible to revert the transition from
# GPLv2+ to GPLv3+. (Rather derive a new GPLv2+ from libburnia.)
create_gnu_xorriso="yes"
current_dir=$(pwd)
lone_dir="$current_dir"/"xorriso-standalone"
2010-05-04 12:06:51 +00:00
xorriso_rev=0.5.7
# For unstable uploads and patch level 0 of stable releases:
xorriso_pl=""
# For higher patch levels of stable releases:
## xorriso_pl=".pl01"
with_bootstrap_tarball=1
create_dir() {
if mkdir "$1"
then
dummy=dummy
else
2008-02-15 21:19:24 +00:00
echo "Failed to create : $1" >&2
exit 1
fi
}
goto_dir() {
if cd "$1"
then
dummy=dummy
else
echo "Failed to cd $1" >&2
exit 1
fi
}
copy_files() {
if cp "$@"
then
dummy=dummy
else
echo "Failed to : cp " "$@" >&2
exit 1
fi
}
if test -e "$lone_dir"
then
echo "Already existing : $lone_dir" >&2
exit 1
fi
# Top level directory
goto_dir "$current_dir"/libisoburn-develop
create_dir "$lone_dir"
copy_files \
AUTHORS \
CONTRIBUTORS \
2008-02-15 21:19:24 +00:00
COPYRIGHT \
COPYING \
INSTALL \
acinclude.m4 \
aclocal.m4 \
bootstrap \
compile \
config.guess \
config.status \
config.sub \
depcomp \
install-sh \
libtool \
ltmain.sh \
missing \
mkinstalldirs \
version.h.in \
\
"$lone_dir"
copy_files xorriso/xorriso_bootstrap.txt "$lone_dir"/bootstrap
copy_files xorriso/configure_ac.txt "$lone_dir"/configure.ac
copy_files xorriso/xorriso_makefile_am.txt "$lone_dir"/Makefile.am
# copy_files xorriso/xorriso_pc_in.txt "$lone_dir"/xorriso.pc.in
2008-02-15 21:19:24 +00:00
# echo "See end of xorriso/changelog.txt" >"$lone_dir"/TODO
# libisoburn
create_dir "$lone_dir"/libisoburn
copy_files \
libisoburn/*.[ch] \
"$lone_dir"/libisoburn
xorriso/convert_man_to_html.sh
2008-01-18 17:03:41 +00:00
create_dir "$lone_dir"/xorriso
copy_files \
xorriso/xorriso.h \
xorriso/xorriso_private.h \
xorriso/sfile.h \
xorriso/sfile.c \
xorriso/aux_objects.h \
xorriso/aux_objects.c \
xorriso/findjob.h \
xorriso/findjob.c \
xorriso/check_media.h \
xorriso/check_media.c \
xorriso/misc_funct.h \
xorriso/misc_funct.c \
xorriso/text_io.h \
xorriso/text_io.c \
xorriso/match.h \
xorriso/match.c \
xorriso/emulators.h \
xorriso/emulators.c \
xorriso/disk_ops.h \
xorriso/disk_ops.c \
xorriso/cmp_update.h \
xorriso/cmp_update.c \
xorriso/parse_exec.h \
xorriso/parse_exec.c \
xorriso/opts_a_c.c \
xorriso/opts_d_h.c \
xorriso/opts_i_o.c \
xorriso/opts_p_z.c \
\
xorriso/xorrisoburn.h \
xorriso/base_obj.h \
xorriso/base_obj.c \
xorriso/lib_mgt.h \
xorriso/lib_mgt.c \
xorriso/sort_cmp.h \
xorriso/sort_cmp.c \
xorriso/drive_mgt.h \
xorriso/drive_mgt.c \
xorriso/iso_img.h \
xorriso/iso_img.c \
xorriso/iso_tree.h \
xorriso/iso_tree.c \
xorriso/iso_manip.h \
xorriso/iso_manip.c \
xorriso/write_run.h \
xorriso/write_run.c \
xorriso/read_run.h \
xorriso/read_run.c \
xorriso/filters.h \
xorriso/filters.c \
\
xorriso/xorriso_main.c \
xorriso/xorriso_timestamp.h \
\
xorriso/changelog.txt \
xorriso/xorriso_eng.html \
xorriso/xorriso.texi \
xorriso/xorriso.info \
xorriso/make_xorriso_1.c \
xorriso/xorriso.1 \
xorriso/man_1_xorriso.html \
"$lone_dir"/xorriso
copy_files xorriso/xorriso_buildstamp_none.h \
"$lone_dir"/xorriso/xorriso_buildstamp.h
2009-04-16 14:56:13 +00:00
copy_files xorriso/xorriso_buildstamp_none.h \
"$lone_dir"/xorriso/xorriso_buildstamp_none.h
create_dir "$lone_dir"/test
copy_files \
test/compare_file.c \
"$lone_dir"/test/compare_file.c
# nglibisofs
create_dir "$lone_dir"/libisofs
2008-03-04 17:41:43 +00:00
create_dir "$lone_dir"/libisofs/filters
create_dir "$lone_dir"/doc
goto_dir "$current_dir"/nglibisofs-develop
2008-01-28 17:20:10 +00:00
copy_files libisofs/*.[ch] "$lone_dir"/libisofs
2008-03-04 17:41:43 +00:00
copy_files libisofs/filters/*.[ch] "$lone_dir"/libisofs/filters
copy_files doc/susp_aaip*.txt "$lone_dir"/doc
copy_files doc/zisofs_format.txt "$lone_dir"/doc
copy_files doc/checksums.txt "$lone_dir"/doc
2008-02-15 21:19:24 +00:00
copy_files COPYRIGHT "$lone_dir"/libisofs
test -e CONTRIBUTORS && cat CONTRIBUTORS >>"$lone_dir"/CONTRIBUTORS
# To get a common version.h
cat version.h.in >> "$lone_dir"/version.h.in
2008-01-31 15:22:23 +00:00
# <<< obsoleted patchings
2008-01-24 20:16:52 +00:00
if test 1 = 0
then
# Change GNU macro name to POSIX name
sed -e 's/FNM_FILE_NAME/FNM_PATHNAME/g' \
<libisofs/tree.c >"$lone_dir"/libisofs/tree.c
# Filter out the semi-illegal TODO comments
( cd "$lone_dir"/libisofs && grep '^[[:space:]]*//' *.[ch] | less )
echo "Is it ok delete all shown //-lines ?"
read yesno
if test "$yesno" = "y" -o "$yesno" = "1"
then
for i in "$lone_dir"/libisofs/*.[ch]
do
# first copy attributes
cp "$i" "$lone_dir"/libisofs/tmpfile
# now filter away // lines
grep -v '^[[:space:]]*//' <"$i" >"$lone_dir"/libisofs/tmpfile && \
mv "$lone_dir"/libisofs/tmpfile "$i"
done
fi
echo "Remaining // lines:"
( cd "$lone_dir"/libisofs && grep '//' *.[ch] )
2008-01-24 20:16:52 +00:00
fi
# libburn
create_dir "$lone_dir"/libburn
goto_dir "$current_dir"/libburn-develop
copy_files libburn/*.[ch] "$lone_dir"/libburn
2008-02-15 21:19:24 +00:00
copy_files COPYRIGHT "$lone_dir"/libburn
cat CONTRIBUTORS >>"$lone_dir"/CONTRIBUTORS
# Delete a source module of yet unclear ancestry.
# The build process will avoid to use it.
rm "$lone_dir"/libburn/crc.c
# To get a common version.h
cat version.h.in >> "$lone_dir"/version.h.in
# Decision about legal situation
goto_dir "$current_dir"/libisoburn-develop
if test "$create_gnu_xorriso" = "yes"
then
copy_files xorriso/README_gnu_xorriso "$lone_dir"/README
copy_files xorriso/COPYRIGHT_gnu_xorriso "$lone_dir"/COPYRIGHT
copy_files xorriso/COPYING_gnu_xorriso "$lone_dir"/COPYING
copy_files xorriso/AUTHORS_gnu_xorriso "$lone_dir"/AUTHORS
# patch xorriso/xorriso.c to be GNU xorriso
sed -e's/define Xorriso_libburnia_xorrisO/define Xorriso_GNU_xorrisO/' \
-e's/This may be changed to Xorriso_GNU_xorrisO in order to c/C/' \
<xorriso/xorriso.h >"$lone_dir"/xorriso/xorriso.h
else
copy_files README "$lone_dir"/README
fi
# tarball
if test "$with_bootstrap_tarball" = 1
then
tarball_dir="$current_dir"/xorriso-"$xorriso_rev""$xorriso_pl"
mv "$lone_dir" "$tarball_dir"
goto_dir "$tarball_dir"
./bootstrap
# Remove unneeded temporary data from ./bootstrap
rm -r ./autom4te.cache
# Repair non-portable shell code output of ./bootstrap
(
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
)
if test "$create_gnu_xorriso" = "yes"
then
# ftp-upload@gnu.org rejects Makefile.in with a dangerous chmod on make dist
sed -e 's/-perm -777 -exec chmod a+rwx/-perm -755 -exec chmod u+rwx,go+rx/' \
< Makefile.in > new_Makefile.in
mv new_Makefile.in Makefile.in
fi
cd "$current_dir"
tar czf ./xorriso-"$xorriso_rev""$xorriso_pl".tar.gz $(basename "$tarball_dir")
ls -l $(pwd)/xorriso-"$xorriso_rev""$xorriso_pl".tar.gz
mv "$tarball_dir" "$lone_dir"
fi
echo "Done"
echo "HINT: Now build xorriso/xorriso by:"
echo " cd '$lone_dir' && ./configure && make"
echo