Changeset b2647de for app


Ignore:
Timestamp:
03/17/08 11:35:12 (16 years ago)
Author:
pawelk <pawelk@…>
Branches:
master, help
Children:
d593c5e
Parents:
246900a
git-author:
pawelk <pawelk@…> (03/17/08 11:35:12)
git-committer:
pawelk <pawelk@…> (03/17/08 11:35:12)
Message:

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

Location:
app
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • app/Makefile

    r8d3e6ab rb2647de  
    1414export UTT_DIR=${OUTPUT_DIR} 
    1515 
    16 export UTT_BIN_DIR=${UTT_DIR}/bin                       # executables 
    17 export UTT_CONF_DIR=${UTT_DIR}/etc/utt          # configuration files 
    18 export UTT_LANG_DIR=${UTT_DIR}/share/utt        # language/encoding specific stuff 
    19 export UTT_LIB_DIR=${UTT_DIR}/lib/utt           # some files like ser.l.template, terms.m4 
    20 export UTT_SHARE_DIR=${UTT_DIR}/share           # stuff like documantation (man, info), docs: FAQ, COPYRIGHT, NEWS, README 
     16# executables 
     17export UTT_BIN_DIR=${UTT_DIR}/bin 
     18# configuration files 
     19export UTT_CONF_DIR=${UTT_DIR}/etc/utt 
     20# language/encoding specific stuff 
     21export UTT_LANG_DIR=${UTT_DIR}/share/utt 
     22# some files like ser.l.template, terms.m4 
     23export UTT_LIB_DIR=${UTT_DIR}/lib/utt 
     24# stuff like documantation (man, info), docs: FAQ, COPYRIGHT, NEWS, README 
     25export UTT_SHARE_DIR=${UTT_DIR}/share 
    2126 
    2227############################## 
     
    4348        mkdir -p ${UTT_LANG_DIR} 
    4449        mkdir -p ${UTT_LIB_DIR} 
    45         mkdir -p ${UTT_SHARE_DIR} 
     50        mkdir -p ${UTT_SHARE_DIR}/utt 
     51        mkdir -p ${UTT_SHARE_DIR}/doc/utt 
     52        mkdir -p ${UTT_SHARE_DIR}/info 
     53        mkdir -p ${UTT_SHARE_DIR}/man/man3 
    4654 
    4755.PHONY: components 
     
    6876.PHONY: clean_doc 
    6977clean_doc: 
    70         cd $(CUR_DIR)/doc && make clean ; cd $(CUR_DIR) 
     78        cd $(CUR_DIR)/doc && make clean; cd $(CUR_DIR) 
    7179 
    7280.PHONY: clean_dist 
     
    7886# ------------------------------------------------------------------ 
    7987.PHONY: build 
    80 build: compile build_conf build_lib build_share 
     88build: compile build_conf build_lib build_doc 
    8189        @echo "All files builded successfully!" 
    8290 
    8391.PHONY: build_conf 
    8492build_conf: 
    85         cp $(CUR_DIR)/conf/* $(UTT_CONF_DIR)/ 
     93        cp $(CUR_DIR)/conf/*.conf $(UTT_CONF_DIR)/ 
    8694 
    8795.PHONY: build_lib 
     
    8997        cp $(CUR_DIR)/lib/* $(UTT_LIB_DIR)/ 
    9098 
    91 .PHONY: build_share 
    92 build_share: 
    93         @echo "We need to create documentation here!" 
     99.PHONY: build_doc 
     100build_doc: 
     101        cd $(CUR_DIR)/doc && make && make copy; cd $(CUR_DIR) 
    94102 
    95103 
     
    99107# ------------------------------------------------------------------ 
    100108.PHONY: distribute 
    101 distribute: 
    102         @echo "We need to create distribution here!" 
     109distribute: build dist_tarball dist_rpm 
     110        @echo "All distributions created successfully!" 
    103111 
     112.PHONY: dist_tarball 
     113dist_tarball: build 
     114        cd $(CUR_DIR)/dist && make tarball; cd $(CUR_DIR) 
     115 
     116.PHONY: dist_rpm 
     117dist_rpm: build 
     118        cd $(CUR_DIR)/dist && make rpm; cd $(CUR_DIR) 
     119 
     120.PHONY: dist_deb 
     121dist_deb: build 
     122        cd $(CUR_DIR)/dist && make deb; cd $(CUR_DIR) 
    104123 
    105124 
  • app/dist/Makefile

    r25ae32e rb2647de  
    1 # compile task doesn't compile sources, but just copy some files 
    2 # this should be changed 
    3 # 
    41 
    5 # I put here some variables 
     2# some variables 
    63 
    7 # path, where binaries are placed  
     4# path, where all nessesary files are placed  
    85# (they will be processed for making distribution) 
    9 export _UTT_DIST_DIR=$(shell pwd)/bin 
    10 # path, where distribution file should be placed 
    11 export _UTT_DIST_OUTPUT=$(shell pwd) 
     6export UTT_DIST_DIR=$(UTT_DIR) 
     7# path, where distribution package will be placed 
     8export UTT_DIST_OUTPUT=$(UTT_DIR)/.. 
     9#temp path for making distribution 
     10export UTT_DIST_TMP=$(shell pwd)/dist_tmp 
    1211 
    1312 
     
    1615.PHONY: default 
    1716defaul: 
    18         @echo "Using: make compile|tarball|rpm|deb" 
    19  
    20  
    21 # ----------------------------------------------------------- 
    22 # ----------------------------------------------------------- 
    23 # this task should compile utt application 
    24 .PHONY: compile 
    25 compile: 
    26         if test -d ${_UTT_DIST_DIR}; then rm -fr ${_UTT_DIST_DIR}; fi 
    27         mkdir -p ${_UTT_DIST_DIR} 
    28         @# fake compilation 
    29         cp -r ../utt-0.9/* ${_UTT_DIST_DIR}/ 
    30         @# we add some extra file (required during instalation) 
    31         cp common/create_utt_config.pl ${_UTT_DIST_DIR}/ 
    32         chmod 700 ${_UTT_DIST_DIR}/create_utt_config.pl 
     17        @echo "Using: make tarball|rpm|deb" 
    3318 
    3419 
     
    3621# this task should compile utt (if nesessery) and create tar.gz version 
    3722.PHONY: tarball 
    38 tarball: compile 
     23tarball: 
    3924        cd tarball && make 
    4025 
     
    4227# this task should compile utt (if nesessery) and create rpm version 
    4328.PHONY: rpm 
    44 rpm: compile 
     29rpm: 
    4530        @#we build rpm (see spec/README for details) 
    4631        cd spec && make 
     
    4934# this task should compile utt (if nesessery) and create deb version 
    5035.PHONY: deb 
    51 deb: compile 
     36deb: 
    5237        @#we build deb (see deb/README for details) 
    5338        cd deb && make 
     
    5843clean: 
    5944        # finally the line below should be uncomment 
    60         rm -fr ${_UTT_DIST_DIR} 
     45        rm -fr ${UTT_DIST_TMP} 
    6146 
  • app/dist/spec/Makefile

    r25ae32e rb2647de  
    33DIR=$(shell pwd) 
    44 
    5 ifndef _UTT_DIST_DIR 
    6         _UTT_DIST_DIR=${DIR} 
     5ifndef UTT_DIST_DIR 
     6        UTT_DIST_DIR=${DIR} 
    77endif 
    88 
    9  
     9_RPM_FROOT=${DIR}/rmp_root 
     10_UTT_ROOT=${_RPM_FROOT}/usr/local 
    1011# default task 
    1112.PHONY: rpm 
    1213rpm: 
    13         cd ${_UTT_DIST_DIR}; rpmbuild -bb ${DIR}/utt.spec 
     14        if test -d ${_RPM_FROOT}; then rm -fr ${_RMP_FROOT}; fi 
     15        mkdir -p ${_UTT_ROOT} 
     16        cp -rf ${UTT_DIST_DIR}/* ${_UTT_ROOT}/ 
     17        cp ../common/utt_make_config.pl ${_UTT_ROOT}/bin/ 
     18        chmod 755 ${_UTT_ROOT}/bin/utt_make_config.pl 
     19        cp ../files/* ${_UTT_ROOT}/ 
     20        cd ${_RPM_FROOT}; rpmbuild -bb ${DIR}/utt.spec 
    1421         
    15  
     22        rm -rf ${_RPM_FROOT} 
     23         
  • app/dist/spec/utt.spec

    r25ae32e rb2647de  
    1111%define _this_summary     Some tools for text processing 
    1212%define _this_name        utt 
    13 %define _this_version     %(cat ../common/version.def) 
    14 %define _this_release     %(cat ../common/release.def) 
     13%define _this_version     %(cat ../../common/version.def) 
     14%define _this_release     %(cat ../../common/release.def) 
    1515%define _this_copyright   Adam Mickiewicz University, Poland 
    16  
    17 # 
    18 # We need some paths 
    19 # 
    20 # Directory with utt binaries 
    21 %define _UTT_DIST_DIR   %(pwd) 
    22 #Root directory in which utt will be installed 
    23 %define _UTT_DIR                /usr/local/%_this_name 
    24 #Directory for rpm 
    25 %define _RPM_ROOT       %_UTT_DIST_DIR/../rpm_root 
    2616 
    2717# 
     
    4030URL:         http://utt.amu.edu.pl 
    4131Vendor:      Adam Mickiewicz University 
    42 BuildRoot:   %_RPM_ROOT 
     32BuildRoot:      %(pwd) 
    4333#BuildArch:      i586 
    4434# requirements for utt application 
     
    5343 
    5444%description 
    55 %(cat ../common/description.def) 
     45%(cat ../../common/description.def) 
    5646 
    5747%description -l pl 
    58 %(cat ../common/description.pl.def) 
     48%(cat ../../common/description.pl.def) 
    5949 
    6050 
     
    6858# rpm building 
    6959%install 
    70 %__mkdir_p $RPM_BUILD_ROOT%_UTT_DIR 
    71 cp -fr %_UTT_DIST_DIR/* $RPM_BUILD_ROOT%_UTT_DIR/ 
    72  
    7360 
    7461# cleaning after rpm build 
    7562%clean 
    76 rm -rf $RPM_BUILD_ROOT 
    7763 
    7864# ------------------------------------------------------------- 
     
    8066%pre 
    8167 
    82  
    8368#after installation 
    8469%post 
    8570# we need to create utt.conf file 
    86 %_UTT_DIR/create_utt_config.pl 
    87 rm -f %_UTT_DIR/create_utt_config.pl 
    88 # we need to create links in /usr/local/bin 
    89 find %_UTT_DIR/bin/ -type f -exec ln -f {} /usr/local/bin \; 
    90  
    9171 
    9272#before uninstallation 
    9373%preun 
    94 # we delete links from /usr/local/bin 
    95 for fn in `find %_UTT_DIR/bin/ -type f -exec basename {} \;`; do rm -f /usr/local/bin/$fn; done 
    96  
    9774 
    9875#after uninstallation 
    9976%postun 
    100 # we remove all extra files 
    101 rm -fr %_UTT_DIR 
    10277 
    10378# ------------------------------------------------------------- 
  • app/dist/tarball/Makefile

    r25ae32e rb2647de  
    55# 
    66 
     7DIR=$(shell pwd) 
     8 
    79# Directory with utt binaries 
    8 ifndef _UTT_DIST_DIR 
    9         _UTT_DIST_DIR=${DIR} 
     10ifndef UTT_DIST_DIR 
     11        UTT_DIST_DIR=${DIR} 
    1012endif 
    1113 
    1214# Where put result 
    13 ifndef _UTT_DIST_OUTPUT 
    14         _UTT_DIST_OUTPUT=${DIR} 
     15ifndef UTT_DIST_OUTPUT 
     16        UTT_DIST_OUTPUT=${DIR} 
    1517endif 
    1618 
     
    2022 
    2123# Temp vars 
    22 DIR=$(shell pwd) 
    23 _TARBALL_ROOT=$(DIR)/utt_$(_UTT_VER)-$(_UTT_REL) 
     24_TARBALL_ROOT=$(DIR)/utt-$(_UTT_VER).$(_UTT_REL) 
    2425_TAR_FILE_NAME=utt.$(_UTT_VER)_$(_UTT_REL).tar.gz 
    2526 
     
    2728.PHONY: default 
    2829default: 
    29         @echo Build dir is ${_UTT_DIST_DIR} 
    30         @echo Change output for tarball as ${_UTT_DIST_OUTPUT} 
     30        @echo Build directory: ${UTT_DIST_DIR} 
     31        @echo Output directory for tarball: ${UTT_DIST_OUTPUT} 
    3132        mkdir -p ${_TARBALL_ROOT} 
    32         cp -fr ${_UTT_DIST_DIR}/* ${_TARBALL_ROOT} 
     33        cp -fr ${UTT_DIST_DIR}/* ${_TARBALL_ROOT} 
    3334        @# we add some extra files 
     35        cp ../common/utt_make_config.pl ${_TARBALL_ROOT}/bin/ 
     36        chmod 755 ${_TARBALL_ROOT}/bin/utt_make_config.pl 
    3437        cp ./INSTALL ${_TARBALL_ROOT}/ 
     38        cp ../files/* ${_TARBALL_ROOT}/ 
    3539 
    36         tar -czf ${_UTT_DIST_OUTPUT}/${_TAR_FILE_NAME} utt* 
     40        tar -czf ${UTT_DIST_OUTPUT}/${_TAR_FILE_NAME} utt* 
    3741 
    3842        rm -rf ${_TARBALL_ROOT} 
     43 
  • app/doc/Makefile

    r25ae32e rb2647de  
    1919 
    2020copy: 
    21 ifdef UTT_DOC_DIR 
    22         cp utt.{info,ps,pdf,html} ${UTT_DOC_DIR} 
     21ifdef UTT_SHARE_DIR 
     22        # tworzymy archiwa (wymagane przez programy) 
     23        gzip --best utt.info 
     24        mv utt.info.gz ${UTT_SHARE_DIR}/info/ 
     25 
     26        # tworzymy archiwa (wymagane przez programy) 
     27        #gzip --best utt.man 
     28        #mv utt.man.gz ${UTT_SHARE_DIR}/man/man3/utt.gz.1 
     29 
     30        #pozostale dokumenty 
     31        mv utt.{ps,pdf,html} ${UTT_SHARE_DIR}/doc/utt/ 
    2332endif 
    2433 
Note: See TracChangeset for help on using the changeset viewer.