Size: 130
Comment:
|
Size: 6101
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
This program takes an ESM file(possible file extensions are .esm, .dd, .tgd or .add), downloaded from a digital tachograph or a driver card (used in the European Union for trucks > 3.5 tons), and converts it into human-readable form, either html or simple plaintext. | |
Line 3: | Line 4: |
* wget [[http://sourceforge.net/projects/readesm/files/readesm/2011-10/readesm-2011.10-Source.tar.bz2/download]] | Project page [[http://sourceforge.net/projects/readesm/]]. == Slackbuild == Run commands: * APPNAME=readesm * SOURCECODE=readesm-2011.12pre1.tar.bz2 * cd /tmp * mkdir $APPNAME * cd $APPNAME * wget [[http://heanet.dl.sourceforge.net/project/readesm/readesm/2011-12/readesm-2011.12pre1-Source.tar.bz2]] * mv readesm-2011.12pre1-Source.tar.bz2 $SOURCECODE * touch $APPNAME.SlackBuild * touch slack-desc * tar -xvif $SOURCECODE || exit 1 * nano slack-desc #fill slack-desc * nano readesm.SlackBuild #fill readesm.SlackBuild * chmod 755 $APPNAME.SlackBuild * ./$APPNAME.SlackBuild * installpkg /tmp/ === Content of slack-desc === {{{#!highlight bash # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. |-----handy-ruler------------------------------------------------------| readesm: readesm - Shows the content of digital tachograph files readesm: This program takes an ESM file(possible file extensions are .esm, .dd, readesm: .tgd or .add), downloaded from a digital tachograph or a driver card readesm: (used in the European Union for trucks > 3.5 tons), and converts it readesm: into human-readable form, either html or simple plaintext. readesm: readesm: Homepage: http://readesm.sourceforge.net/ readesm: Homepage: http://sourceforge.net/projects/readesm/ readesm: readesm: readesm: }}} === Content of readesm.SlackBuild === {{{#!highlight bash #!/bin/sh -e #V.B. revision date 2013/07/04 #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi # The version which appears in the application's filename VERSION=2011.12pre1 # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2011.12pre1 # the version which appears in the package name. ARCH=${ARCH:-i486} # the architecture on which you want to build your package # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_SBo} # The application's name APP=readesm # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -xvif $CWD/$APP-$VERSION.tar.bz2 || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . # buils Unix makefiles cmake -G 'Unix Makefiles' echo 'Patching some source files as stated in http://sourceforge.net/p/readesm/bugs/2/' sed -i 's/Block11Record.h/block11Record.h/g' ./fileformat/DataTypes/block11Record.cpp sed -i 's/Block11.h/block11.h/g' ./fileformat/VuBlocks/block11.cpp sed -i 's/Block11Record.h/block11Record.h/g' ./fileformat/VuBlocks/block11.h sed -i 's/Block13.h/block13.h/g' ./fileformat/VuBlocks/block13.cpp sed -i 's/Block11Record.h/block11Record.h/g' ./fileformat/VuBlocks/block13.h sed -i 's/Block13.h/block13.h/g' ./fileformat/VuBlocks/vuBlockFactory.cpp sed -i 's/Block11.h/block11.h/g' ./fileformat/VuBlocks/vuBlockFactory.cpp # clean the source, but exit if anything goes wrong make clean || exit # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a COPYING CHANGELOG README $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; # slackbuild copy cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild echo "Create the ./install directory and copy the slack-desc into it" mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc echo "Add doinst.sh to package (if it exists)" if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi echo "Strip some libraries and binaries" ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) echo "Compress man pages if they exist" if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi echo "Compress info pages if they exist (and remove the dir file)" if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi echo "Build the package" cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz }}} |
Readesm
This program takes an ESM file(possible file extensions are .esm, .dd, .tgd or .add), downloaded from a digital tachograph or a driver card (used in the European Union for trucks > 3.5 tons), and converts it into human-readable form, either html or simple plaintext.
Project page http://sourceforge.net/projects/readesm/.
Slackbuild
Run commands:
- APPNAME=readesm
- SOURCECODE=readesm-2011.12pre1.tar.bz2
- cd /tmp
- mkdir $APPNAME
- cd $APPNAME
wget http://heanet.dl.sourceforge.net/project/readesm/readesm/2011-12/readesm-2011.12pre1-Source.tar.bz2
- mv readesm-2011.12pre1-Source.tar.bz2 $SOURCECODE
touch $APPNAME.SlackBuild
- touch slack-desc
tar -xvif $SOURCECODE || exit 1
- nano slack-desc #fill slack-desc
nano readesm.SlackBuild #fill readesm.SlackBuild
chmod 755 $APPNAME.SlackBuild
./$APPNAME.SlackBuild
- installpkg /tmp/
Content of slack-desc
1 # HOW TO EDIT THIS FILE:
2 # The "handy ruler" below makes it easier to edit a package description. Line
3 # up the first '|' above the ':' following the base package name, and the '|' on
4 # the right side marks the last column you can put a character in. You must make
5 # exactly 11 lines for the formatting to be correct. It's also customary to
6 # leave one space after the ':'.
7
8 |-----handy-ruler------------------------------------------------------|
9 readesm: readesm - Shows the content of digital tachograph files
10 readesm: This program takes an ESM file(possible file extensions are .esm, .dd,
11 readesm: .tgd or .add), downloaded from a digital tachograph or a driver card
12 readesm: (used in the European Union for trucks > 3.5 tons), and converts it
13 readesm: into human-readable form, either html or simple plaintext.
14 readesm:
15 readesm: Homepage: http://readesm.sourceforge.net/
16 readesm: Homepage: http://sourceforge.net/projects/readesm/
17 readesm:
18 readesm:
19 readesm:
Content of readesm.SlackBuild
1 #!/bin/sh -e
2 #V.B. revision date 2013/07/04
3 #Set initial variables:
4 CWD=$(pwd)
5 if [ "$TMP" = "" ]; then
6 TMP=/tmp
7 fi
8
9 # The version which appears in the application's filename
10 VERSION=2011.12pre1
11 # If the version conflicts with the Slackware package standard
12 # The dash character ("-") is not allowed in the VERSION string
13 # You can set the PKG_VERSION to something else than VERSION
14 PKG_VERSION=2011.12pre1 # the version which appears in the package name.
15 ARCH=${ARCH:-i486} # the architecture on which you want to build your package
16 # First digit is the build number, which specifies how many times it has been built.
17 # Second string is the short form of the authors name, typical three initials:w
18 BUILD=${BUILD:-1_SBo}
19 # The application's name
20 APP=readesm
21 # The installation directory of the package (where its actual directory
22 # structure will be created)
23 PKG=$TMP/package-$APP
24
25 if [ "$ARCH" = "i486" ]; then
26 SLKCFLAGS="-O2 -march=i486 -mtune=i686"
27 elif [ "$ARCH" = "x86_64" ]; then
28 SLKCFLAGS="-O2 -fPIC"
29 fi
30
31 # Delete the leftover directories if they exist (due to a previous build)
32 # and (re)create the packaging directory
33 rm -rf $PKG
34 mkdir -p $TMP $PKG
35 rm -rf $TMP/$APP-$VERSION
36
37 # Change to the TMP directory
38 cd $TMP || exit 1
39
40 # Extract the application source in TMP
41 # Note: if your application comes as a tar.bz2, you need tar -jxvf
42 tar -xvif $CWD/$APP-$VERSION.tar.bz2 || exit 1
43
44 # Change to the application source directory
45 cd $APP-$VERSION || exit 1
46
47 # Change ownership and permissions if necessary
48 # This may not be needed in some source tarballs, but it never hurts
49 chown -R root:root .
50 chmod -R u+w,go+r-w,a-s .
51
52 # buils Unix makefiles
53 cmake -G 'Unix Makefiles'
54
55 echo 'Patching some source files as stated in http://sourceforge.net/p/readesm/bugs/2/'
56 sed -i 's/Block11Record.h/block11Record.h/g' ./fileformat/DataTypes/block11Record.cpp
57 sed -i 's/Block11.h/block11.h/g' ./fileformat/VuBlocks/block11.cpp
58 sed -i 's/Block11Record.h/block11Record.h/g' ./fileformat/VuBlocks/block11.h
59 sed -i 's/Block13.h/block13.h/g' ./fileformat/VuBlocks/block13.cpp
60 sed -i 's/Block11Record.h/block11Record.h/g' ./fileformat/VuBlocks/block13.h
61 sed -i 's/Block13.h/block13.h/g' ./fileformat/VuBlocks/vuBlockFactory.cpp
62 sed -i 's/Block11.h/block11.h/g' ./fileformat/VuBlocks/vuBlockFactory.cpp
63
64 # clean the source, but exit if anything goes wrong
65 make clean || exit
66
67 # compile the source, but exit if anything goes wrong
68 make || exit
69
70 # Install everything into the package directory, but exit if anything goes wrong
71 make install DESTDIR=$PKG || exit
72
73 # Create a directory for documentation
74 mkdir -p $PKG/usr/doc/$APP-$VERSION
75
76 # Copy documentation to the docs directory and fix permissions
77 cp -a COPYING CHANGELOG README $PKG/usr/doc/$APP-$VERSION
78 find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \;
79 # slackbuild copy
80 cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild
81
82 echo "Create the ./install directory and copy the slack-desc into it"
83 mkdir -p $PKG/install
84 cat $CWD/slack-desc > $PKG/install/slack-desc
85
86 echo "Add doinst.sh to package (if it exists)"
87 if [ -e $CWD/doinst.sh.gz ]; then
88 zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
89 fi
90
91 echo "Strip some libraries and binaries"
92 ( cd $PKG
93 find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
94 find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
95 )
96
97 echo "Compress man pages if they exist"
98 if [ -d $PKG/usr/man ]; then
99 ( cd $PKG/usr/man
100 find . -type f -exec gzip -9 {} \;
101 for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
102 )
103 fi
104
105 echo "Compress info pages if they exist (and remove the dir file)"
106 if [ -d $PKG/usr/info ]; then
107 gzip -9 $PKG/usr/info/*.info
108 rm -f $PKG/usr/info/dir
109 fi
110
111 echo "Build the package"
112 cd $PKG
113 /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz