jpnevulator
Nice serial sniffer and you can use it to send data on a serial line too http://jpnevulator.snarl.nl/.
Slackbuild creation
The SlackBuild is created based on the instructions available in http://www.slackwiki.com/Writing_A_SlackBuild_Script.
Run commands:
- APPNAME=jpnevulator
- SOURCECODE=jpnevulator-2.1.1.tgz
- cd /tmp
- mkdir $APPNAME
- cd $APPNAME
touch $APPNAME.SlackBuild
- touch slack-desc
tar -xzf $SOURCECODE || exit 1
- #fill slack-des
#fill jpnevulator.SlackBuild
chmod 755 $APPNAME.SlackBuild
./$APPNAME.SlackBuild
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 jpnevulator: jpnevulator (serial sniffer)
10 jpnevulator:
11 jpnevulator: Nice serial sniffer and you can use it to send data on a serial
12 jpnevulator: line too. It's sort of like a very simple terminal emulator, like
13 jpnevulator: picocom. But jpnevulator uses hexadecimal byte values to display
14 jpnevulator: and send along the line. Very handy indeed if you are working a
15 jpnevulator: lot with serial protocols.
16 jpnevulator:
17 jpnevulator: Homepage: http://jpnevulator.snarl.nl/.
18 jpnevulator:
19 jpnevulator:
Content of jpnevulator.SlackBuild
1 #!/bin/sh -e
2 #V.B. revision date 2013/06/27
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=2.1.1
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=2.1.1 # 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_rlw}
19 # The application's name
20 APP=jpnevulator
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 -zxvf $CWD/$APP-$VERSION.tar.gz || 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 # Set configure options
53 # If your app is written in C++, you'll also need to add a line for CXXFLAGS
54 CFLAGS="$SLKCFLAGS" \
55 ./configure \
56 --prefix=/usr \
57 --sysconfdir=/etc \
58 --localstatedir=/var \
59 # --with-perl=/usr/bin/perl \
60 # --enable-eps \
61 # --enable-gif \
62 # --enable-png \
63 --build=$ARCH-slackware-linux \
64 --host=$ARCH-slackware-linux
65
66 # compile the source, but exit if anything goes wrong
67 make || exit
68
69 # Install everything into the package directory, but exit if anything goes wrong
70 make install DESTDIR=$PKG || exit
71
72 # Create a directory for documentation
73 mkdir -p $PKG/usr/doc/$APP-$VERSION
74
75 # Copy documentation to the docs directory and fix permissions
76 cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION
77 find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \;
78 # slackbuild copy
79 cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild
80
81 # Create the ./install directory and copy the slack-desc into it
82 mkdir -p $PKG/install
83 cat $CWD/slack-desc > $PKG/install/slack-desc
84
85 # Add doinst.sh to package (if it exists)
86 if [ -e $CWD/doinst.sh.gz ]; then
87 zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
88 fi
89
90 # Strip some libraries and binaries
91 ( cd $PKG
92 find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
93 find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
94 )
95
96 # Compress man pages if they exist
97 if [ -d $PKG/usr/man ]; then
98 ( cd $PKG/usr/man
99 find . -type f -exec gzip -9 {} \;
100 for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
101 )
102 fi
103
104 # Compress info pages if they exist (and remove the dir file)
105 if [ -d $PKG/usr/info ]; then
106 gzip -9 $PKG/usr/info/*.info
107 rm -f $PKG/usr/info/dir
108 fi
109
110 # Build the package
111 cd $PKG
112 /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz