Poprawiłem skrypty, generujące dystrybucję tarball oraz rpm.
Można testować: make dist_tarball oraz make dist_rpm. git-svn-id: svn://atos.wmid.amu.edu.pl/utt@11 e293616e-ec6a-49c2-aa92-f4a8b91c5d16
This commit is contained in:
parent
246900abc9
commit
b2647ded51
47
app/Makefile
47
app/Makefile
@ -13,11 +13,16 @@ OUTPUT_DIR=$(CUR_DIR)/output
|
|||||||
|
|
||||||
export UTT_DIR=${OUTPUT_DIR}
|
export UTT_DIR=${OUTPUT_DIR}
|
||||||
|
|
||||||
export UTT_BIN_DIR=${UTT_DIR}/bin # executables
|
# executables
|
||||||
export UTT_CONF_DIR=${UTT_DIR}/etc/utt # configuration files
|
export UTT_BIN_DIR=${UTT_DIR}/bin
|
||||||
export UTT_LANG_DIR=${UTT_DIR}/share/utt # language/encoding specific stuff
|
# configuration files
|
||||||
export UTT_LIB_DIR=${UTT_DIR}/lib/utt # some files like ser.l.template, terms.m4
|
export UTT_CONF_DIR=${UTT_DIR}/etc/utt
|
||||||
export UTT_SHARE_DIR=${UTT_DIR}/share # stuff like documantation (man, info), docs: FAQ, COPYRIGHT, NEWS, README
|
# language/encoding specific stuff
|
||||||
|
export UTT_LANG_DIR=${UTT_DIR}/share/utt
|
||||||
|
# some files like ser.l.template, terms.m4
|
||||||
|
export UTT_LIB_DIR=${UTT_DIR}/lib/utt
|
||||||
|
# stuff like documantation (man, info), docs: FAQ, COPYRIGHT, NEWS, README
|
||||||
|
export UTT_SHARE_DIR=${UTT_DIR}/share
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
|
|
||||||
@ -42,7 +47,10 @@ dirs:
|
|||||||
mkdir -p ${UTT_CONF_DIR}
|
mkdir -p ${UTT_CONF_DIR}
|
||||||
mkdir -p ${UTT_LANG_DIR}
|
mkdir -p ${UTT_LANG_DIR}
|
||||||
mkdir -p ${UTT_LIB_DIR}
|
mkdir -p ${UTT_LIB_DIR}
|
||||||
mkdir -p ${UTT_SHARE_DIR}
|
mkdir -p ${UTT_SHARE_DIR}/utt
|
||||||
|
mkdir -p ${UTT_SHARE_DIR}/doc/utt
|
||||||
|
mkdir -p ${UTT_SHARE_DIR}/info
|
||||||
|
mkdir -p ${UTT_SHARE_DIR}/man/man3
|
||||||
|
|
||||||
.PHONY: components
|
.PHONY: components
|
||||||
components:
|
components:
|
||||||
@ -67,7 +75,7 @@ clean_components:
|
|||||||
|
|
||||||
.PHONY: clean_doc
|
.PHONY: clean_doc
|
||||||
clean_doc:
|
clean_doc:
|
||||||
cd $(CUR_DIR)/doc && make clean ; cd $(CUR_DIR)
|
cd $(CUR_DIR)/doc && make clean; cd $(CUR_DIR)
|
||||||
|
|
||||||
.PHONY: clean_dist
|
.PHONY: clean_dist
|
||||||
clean_dist:
|
clean_dist:
|
||||||
@ -77,20 +85,20 @@ clean_dist:
|
|||||||
# sekcja przygotowania paczki (programow wraz z dodatkowymi plikami)
|
# sekcja przygotowania paczki (programow wraz z dodatkowymi plikami)
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: compile build_conf build_lib build_share
|
build: compile build_conf build_lib build_doc
|
||||||
@echo "All files builded successfully!"
|
@echo "All files builded successfully!"
|
||||||
|
|
||||||
.PHONY: build_conf
|
.PHONY: build_conf
|
||||||
build_conf:
|
build_conf:
|
||||||
cp $(CUR_DIR)/conf/* $(UTT_CONF_DIR)/
|
cp $(CUR_DIR)/conf/*.conf $(UTT_CONF_DIR)/
|
||||||
|
|
||||||
.PHONY: build_lib
|
.PHONY: build_lib
|
||||||
build_lib:
|
build_lib:
|
||||||
cp $(CUR_DIR)/lib/* $(UTT_LIB_DIR)/
|
cp $(CUR_DIR)/lib/* $(UTT_LIB_DIR)/
|
||||||
|
|
||||||
.PHONY: build_share
|
.PHONY: build_doc
|
||||||
build_share:
|
build_doc:
|
||||||
@echo "We need to create documentation here!"
|
cd $(CUR_DIR)/doc && make && make copy; cd $(CUR_DIR)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -98,9 +106,20 @@ build_share:
|
|||||||
# sekcja tworzenia dystrybucji (tarballa, rpm, deb)
|
# sekcja tworzenia dystrybucji (tarballa, rpm, deb)
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
.PHONY: distribute
|
.PHONY: distribute
|
||||||
distribute:
|
distribute: build dist_tarball dist_rpm
|
||||||
@echo "We need to create distribution here!"
|
@echo "All distributions created successfully!"
|
||||||
|
|
||||||
|
.PHONY: dist_tarball
|
||||||
|
dist_tarball: build
|
||||||
|
cd $(CUR_DIR)/dist && make tarball; cd $(CUR_DIR)
|
||||||
|
|
||||||
|
.PHONY: dist_rpm
|
||||||
|
dist_rpm: build
|
||||||
|
cd $(CUR_DIR)/dist && make rpm; cd $(CUR_DIR)
|
||||||
|
|
||||||
|
.PHONY: dist_deb
|
||||||
|
dist_deb: build
|
||||||
|
cd $(CUR_DIR)/dist && make deb; cd $(CUR_DIR)
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
|
39
app/dist/Makefile
vendored
39
app/dist/Makefile
vendored
@ -1,54 +1,39 @@
|
|||||||
# compile task doesn't compile sources, but just copy some files
|
|
||||||
# this should be changed
|
|
||||||
#
|
|
||||||
|
|
||||||
# I put here some variables
|
# some variables
|
||||||
|
|
||||||
# path, where binaries are placed
|
# path, where all nessesary files are placed
|
||||||
# (they will be processed for making distribution)
|
# (they will be processed for making distribution)
|
||||||
export _UTT_DIST_DIR=$(shell pwd)/bin
|
export UTT_DIST_DIR=$(UTT_DIR)
|
||||||
# path, where distribution file should be placed
|
# path, where distribution package will be placed
|
||||||
export _UTT_DIST_OUTPUT=$(shell pwd)
|
export UTT_DIST_OUTPUT=$(UTT_DIR)/..
|
||||||
|
#temp path for making distribution
|
||||||
|
export UTT_DIST_TMP=$(shell pwd)/dist_tmp
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# default task should display options
|
# default task should display options
|
||||||
.PHONY: default
|
.PHONY: default
|
||||||
defaul:
|
defaul:
|
||||||
@echo "Using: make compile|tarball|rpm|deb"
|
@echo "Using: make tarball|rpm|deb"
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------
|
|
||||||
# -----------------------------------------------------------
|
|
||||||
# this task should compile utt application
|
|
||||||
.PHONY: compile
|
|
||||||
compile:
|
|
||||||
if test -d ${_UTT_DIST_DIR}; then rm -fr ${_UTT_DIST_DIR}; fi
|
|
||||||
mkdir -p ${_UTT_DIST_DIR}
|
|
||||||
@# fake compilation
|
|
||||||
cp -r ../utt-0.9/* ${_UTT_DIST_DIR}/
|
|
||||||
@# we add some extra file (required during instalation)
|
|
||||||
cp common/create_utt_config.pl ${_UTT_DIST_DIR}/
|
|
||||||
chmod 700 ${_UTT_DIST_DIR}/create_utt_config.pl
|
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# this task should compile utt (if nesessery) and create tar.gz version
|
# this task should compile utt (if nesessery) and create tar.gz version
|
||||||
.PHONY: tarball
|
.PHONY: tarball
|
||||||
tarball: compile
|
tarball:
|
||||||
cd tarball && make
|
cd tarball && make
|
||||||
|
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# this task should compile utt (if nesessery) and create rpm version
|
# this task should compile utt (if nesessery) and create rpm version
|
||||||
.PHONY: rpm
|
.PHONY: rpm
|
||||||
rpm: compile
|
rpm:
|
||||||
@#we build rpm (see spec/README for details)
|
@#we build rpm (see spec/README for details)
|
||||||
cd spec && make
|
cd spec && make
|
||||||
|
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# this task should compile utt (if nesessery) and create deb version
|
# this task should compile utt (if nesessery) and create deb version
|
||||||
.PHONY: deb
|
.PHONY: deb
|
||||||
deb: compile
|
deb:
|
||||||
@#we build deb (see deb/README for details)
|
@#we build deb (see deb/README for details)
|
||||||
cd deb && make
|
cd deb && make
|
||||||
|
|
||||||
@ -57,5 +42,5 @@ deb: compile
|
|||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
# finally the line below should be uncomment
|
# finally the line below should be uncomment
|
||||||
rm -fr ${_UTT_DIST_DIR}
|
rm -fr ${UTT_DIST_TMP}
|
||||||
|
|
||||||
|
16
app/dist/spec/Makefile
vendored
16
app/dist/spec/Makefile
vendored
@ -2,14 +2,22 @@
|
|||||||
|
|
||||||
DIR=$(shell pwd)
|
DIR=$(shell pwd)
|
||||||
|
|
||||||
ifndef _UTT_DIST_DIR
|
ifndef UTT_DIST_DIR
|
||||||
_UTT_DIST_DIR=${DIR}
|
UTT_DIST_DIR=${DIR}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
_RPM_FROOT=${DIR}/rmp_root
|
||||||
|
_UTT_ROOT=${_RPM_FROOT}/usr/local
|
||||||
# default task
|
# default task
|
||||||
.PHONY: rpm
|
.PHONY: rpm
|
||||||
rpm:
|
rpm:
|
||||||
cd ${_UTT_DIST_DIR}; rpmbuild -bb ${DIR}/utt.spec
|
if test -d ${_RPM_FROOT}; then rm -fr ${_RMP_FROOT}; fi
|
||||||
|
mkdir -p ${_UTT_ROOT}
|
||||||
|
cp -rf ${UTT_DIST_DIR}/* ${_UTT_ROOT}/
|
||||||
|
cp ../common/utt_make_config.pl ${_UTT_ROOT}/bin/
|
||||||
|
chmod 755 ${_UTT_ROOT}/bin/utt_make_config.pl
|
||||||
|
cp ../files/* ${_UTT_ROOT}/
|
||||||
|
cd ${_RPM_FROOT}; rpmbuild -bb ${DIR}/utt.spec
|
||||||
|
|
||||||
|
rm -rf ${_RPM_FROOT}
|
||||||
|
|
||||||
|
35
app/dist/spec/utt.spec
vendored
35
app/dist/spec/utt.spec
vendored
@ -10,20 +10,10 @@
|
|||||||
%define _this_product UAM Text Tools
|
%define _this_product UAM Text Tools
|
||||||
%define _this_summary Some tools for text processing
|
%define _this_summary Some tools for text processing
|
||||||
%define _this_name utt
|
%define _this_name utt
|
||||||
%define _this_version %(cat ../common/version.def)
|
%define _this_version %(cat ../../common/version.def)
|
||||||
%define _this_release %(cat ../common/release.def)
|
%define _this_release %(cat ../../common/release.def)
|
||||||
%define _this_copyright Adam Mickiewicz University, Poland
|
%define _this_copyright Adam Mickiewicz University, Poland
|
||||||
|
|
||||||
#
|
|
||||||
# We need some paths
|
|
||||||
#
|
|
||||||
# Directory with utt binaries
|
|
||||||
%define _UTT_DIST_DIR %(pwd)
|
|
||||||
#Root directory in which utt will be installed
|
|
||||||
%define _UTT_DIR /usr/local/%_this_name
|
|
||||||
#Directory for rpm
|
|
||||||
%define _RPM_ROOT %_UTT_DIST_DIR/../rpm_root
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Default RPM header.
|
# Default RPM header.
|
||||||
#
|
#
|
||||||
@ -39,7 +29,7 @@ License: GPL
|
|||||||
Group: Development/Tools
|
Group: Development/Tools
|
||||||
URL: http://utt.amu.edu.pl
|
URL: http://utt.amu.edu.pl
|
||||||
Vendor: Adam Mickiewicz University
|
Vendor: Adam Mickiewicz University
|
||||||
BuildRoot: %_RPM_ROOT
|
BuildRoot: %(pwd)
|
||||||
#BuildArch: i586
|
#BuildArch: i586
|
||||||
# requirements for utt application
|
# requirements for utt application
|
||||||
#AutoReq: no
|
#AutoReq: no
|
||||||
@ -52,10 +42,10 @@ BuildRoot: %_RPM_ROOT
|
|||||||
#Requires: libstdc++ >= 3.4.1
|
#Requires: libstdc++ >= 3.4.1
|
||||||
|
|
||||||
%description
|
%description
|
||||||
%(cat ../common/description.def)
|
%(cat ../../common/description.def)
|
||||||
|
|
||||||
%description -l pl
|
%description -l pl
|
||||||
%(cat ../common/description.pl.def)
|
%(cat ../../common/description.pl.def)
|
||||||
|
|
||||||
|
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
@ -67,38 +57,23 @@ BuildRoot: %_RPM_ROOT
|
|||||||
|
|
||||||
# rpm building
|
# rpm building
|
||||||
%install
|
%install
|
||||||
%__mkdir_p $RPM_BUILD_ROOT%_UTT_DIR
|
|
||||||
cp -fr %_UTT_DIST_DIR/* $RPM_BUILD_ROOT%_UTT_DIR/
|
|
||||||
|
|
||||||
|
|
||||||
# cleaning after rpm build
|
# cleaning after rpm build
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
#before installation
|
#before installation
|
||||||
%pre
|
%pre
|
||||||
|
|
||||||
|
|
||||||
#after installation
|
#after installation
|
||||||
%post
|
%post
|
||||||
# we need to create utt.conf file
|
# we need to create utt.conf file
|
||||||
%_UTT_DIR/create_utt_config.pl
|
|
||||||
rm -f %_UTT_DIR/create_utt_config.pl
|
|
||||||
# we need to create links in /usr/local/bin
|
|
||||||
find %_UTT_DIR/bin/ -type f -exec ln -f {} /usr/local/bin \;
|
|
||||||
|
|
||||||
|
|
||||||
#before uninstallation
|
#before uninstallation
|
||||||
%preun
|
%preun
|
||||||
# we delete links from /usr/local/bin
|
|
||||||
for fn in `find %_UTT_DIR/bin/ -type f -exec basename {} \;`; do rm -f /usr/local/bin/$fn; done
|
|
||||||
|
|
||||||
|
|
||||||
#after uninstallation
|
#after uninstallation
|
||||||
%postun
|
%postun
|
||||||
# we remove all extra files
|
|
||||||
rm -fr %_UTT_DIR
|
|
||||||
|
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
%files
|
%files
|
||||||
|
25
app/dist/tarball/Makefile
vendored
25
app/dist/tarball/Makefile
vendored
@ -4,14 +4,16 @@
|
|||||||
# Some variables
|
# Some variables
|
||||||
#
|
#
|
||||||
|
|
||||||
|
DIR=$(shell pwd)
|
||||||
|
|
||||||
# Directory with utt binaries
|
# Directory with utt binaries
|
||||||
ifndef _UTT_DIST_DIR
|
ifndef UTT_DIST_DIR
|
||||||
_UTT_DIST_DIR=${DIR}
|
UTT_DIST_DIR=${DIR}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Where put result
|
# Where put result
|
||||||
ifndef _UTT_DIST_OUTPUT
|
ifndef UTT_DIST_OUTPUT
|
||||||
_UTT_DIST_OUTPUT=${DIR}
|
UTT_DIST_OUTPUT=${DIR}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Common info about version and release
|
# Common info about version and release
|
||||||
@ -19,20 +21,23 @@ _UTT_VER=$(shell cat ../common/version.def)
|
|||||||
_UTT_REL=$(shell cat ../common/release.def)
|
_UTT_REL=$(shell cat ../common/release.def)
|
||||||
|
|
||||||
# Temp vars
|
# Temp vars
|
||||||
DIR=$(shell pwd)
|
_TARBALL_ROOT=$(DIR)/utt-$(_UTT_VER).$(_UTT_REL)
|
||||||
_TARBALL_ROOT=$(DIR)/utt_$(_UTT_VER)-$(_UTT_REL)
|
|
||||||
_TAR_FILE_NAME=utt.$(_UTT_VER)_$(_UTT_REL).tar.gz
|
_TAR_FILE_NAME=utt.$(_UTT_VER)_$(_UTT_REL).tar.gz
|
||||||
|
|
||||||
#defualt task
|
#defualt task
|
||||||
.PHONY: default
|
.PHONY: default
|
||||||
default:
|
default:
|
||||||
@echo Build dir is ${_UTT_DIST_DIR}
|
@echo Build directory: ${UTT_DIST_DIR}
|
||||||
@echo Change output for tarball as ${_UTT_DIST_OUTPUT}
|
@echo Output directory for tarball: ${UTT_DIST_OUTPUT}
|
||||||
mkdir -p ${_TARBALL_ROOT}
|
mkdir -p ${_TARBALL_ROOT}
|
||||||
cp -fr ${_UTT_DIST_DIR}/* ${_TARBALL_ROOT}
|
cp -fr ${UTT_DIST_DIR}/* ${_TARBALL_ROOT}
|
||||||
@# we add some extra files
|
@# we add some extra files
|
||||||
|
cp ../common/utt_make_config.pl ${_TARBALL_ROOT}/bin/
|
||||||
|
chmod 755 ${_TARBALL_ROOT}/bin/utt_make_config.pl
|
||||||
cp ./INSTALL ${_TARBALL_ROOT}/
|
cp ./INSTALL ${_TARBALL_ROOT}/
|
||||||
|
cp ../files/* ${_TARBALL_ROOT}/
|
||||||
|
|
||||||
tar -czf ${_UTT_DIST_OUTPUT}/${_TAR_FILE_NAME} utt*
|
tar -czf ${UTT_DIST_OUTPUT}/${_TAR_FILE_NAME} utt*
|
||||||
|
|
||||||
rm -rf ${_TARBALL_ROOT}
|
rm -rf ${_TARBALL_ROOT}
|
||||||
|
|
||||||
|
@ -18,8 +18,17 @@ utt.ps: utt.dvi
|
|||||||
|
|
||||||
|
|
||||||
copy:
|
copy:
|
||||||
ifdef UTT_DOC_DIR
|
ifdef UTT_SHARE_DIR
|
||||||
cp utt.{info,ps,pdf,html} ${UTT_DOC_DIR}
|
# tworzymy archiwa (wymagane przez programy)
|
||||||
|
gzip --best utt.info
|
||||||
|
mv utt.info.gz ${UTT_SHARE_DIR}/info/
|
||||||
|
|
||||||
|
# tworzymy archiwa (wymagane przez programy)
|
||||||
|
#gzip --best utt.man
|
||||||
|
#mv utt.man.gz ${UTT_SHARE_DIR}/man/man3/utt.gz.1
|
||||||
|
|
||||||
|
#pozostale dokumenty
|
||||||
|
mv utt.{ps,pdf,html} ${UTT_SHARE_DIR}/doc/utt/
|
||||||
endif
|
endif
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
Loading…
Reference in New Issue
Block a user