Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Packaging #15

Merged
merged 5 commits into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 12, 2013
  1. @MarwanG

    script fixing

    MarwanG authored
  2. @MarwanG

    one single makefile

    MarwanG authored
  3. @MarwanG

    fix for byte compilation

    MarwanG authored
  4. @MarwanG

    packaging scripts fix

    MarwanG authored
  5. @MarwanG

    compile and cleanup scripts

    MarwanG authored
This page is out of date. Refresh to see the latest.
View
56 Makefile.in
@@ -1,28 +1,50 @@
-# where to install
-PREFIX = @prefix@
-BINDIR = $(PREFIX)/bin
+# where to install the binaries
+prefix=/usr/local
+exec_prefix=${prefix}
+BINDIR=${exec_prefix}/bin
-SRCS = $(wildcard src/*.ml src/*.mli src/*.mll src/*.mly)
-TARGS = arbogen
-KIND = native # d.byte
-FLAGS = -w,Ae,-warn-error,A
+# where to install the man page
+MANDIR=${prefix}/share/man
-all: $(TARGS)
+# other variables set by ./configure
+OCAMLC = ocamlc
+OCAMLOPT = ocamlopt
+OCAMLDEP = ocamldep
+OCAMLLEX = ocamllex
+OCAMLYACC= ocamlyacc
+OCAMLLIB = /usr/lib/ocaml
+OCAMLBEST= op
+
+OCAMLFLAG= -I src/
+
+SRCS = src/Options.ml src/Util.ml src/Grammar.ml src/CombSys.ml src/OracleSimple.ml src/Tree.ml src/Gen.ml src/GParser.ml src/ArboLib.ml src/Arbogen.ml
+
+
+all: arbogen
+
+arbogen: $(SRCS)
+ mkdir bin
+ $(OCAMLOPT) $(OCAMLFLAG) -o bin/arbogen $(SRCS)
+
+arbogen.byte: $(SRCS)
+ mkdir bin
+ $(OCAMLC) $(OCAMLFLAG) -o bin/arbogen.byte $(SRCS)
-arbogen: _build/src/Arbogen.$(KIND)
- cp $< $@
install:: arbogen
mkdir -p $(BINDIR)
- mv arbogen $(BINDIR)
+ mv bin/arbogen $(BINDIR)
mkdir -p $(MANDIR)/man1
cp -f doc/$(TARGS).1 /usr/local/man/man1/$(TARGS).1
-_build/src/%.$(KIND): $(SRCS)
- ocamlbuild -cflags $(FLAGS) -no-links -I src $*.$(KIND)
-
clean:
- @ocamlbuild -clean
- @rm -f *~ $(TARGS)
+ rm -f src/*~
+ rm -f src/*.cmi
+ rm -f src/*.cmx
+ rm -f src/*.cmo
+ rm -f src/*.o
-.PHONY: all clean
+cleanall: clean
+ rm -f bin/arbogen
+ rm -f bin/arbogen.byte
+ rm -rf bin
View
13 cleanup.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+#cleanup.sh
+
+if [ -f Makefile ]; then
+ make cleanall
+fi
+rm -rf Makefile
+rm -rf configure
+rm -rf config.status
+rm -rf autom4te.cache
+rm -rf config.log
+rm -rf arbogen_`cat VERSION`_1
+rm -rf *~
View
31 compile.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+#config.sh
+#if output of makefile needs to be a byte pass as parameter arbogen.byte
+
+if [ -f configure ]; then
+ echo "checking for configure file... ok"
+else
+ echo "checking for configure file... no"
+ if which autoconf >/dev/null; then
+ echo "checking for autoconf... ok"
+ autoconf
+ echo "creating configure file... ok"
+ else
+ echo "checking for autoconf... no"
+ exit 1;
+ fi
+fi
+
+echo "executing configure script"
+./configure
+
+if [ -f Makefile ]; then
+ echo "checking for Makefile... ok"
+ make $1
+else
+ echo "checking for Makefile... no"
+ echo "error... Aborting"
+ exit 1;
+fi
+
+
View
22 debianBin.sh → debianBin_amd64.sh
@@ -2,12 +2,14 @@
#debianBin.sh
#creates a binary debian package from source files
+file=arbogen_`cat VERSION`_1
-if [ ! -f arbogen ]; then
- echo "checking for binary file... no"
+#testing if in correct folder
+if [ ! -f configure.in ]; then
+ echo "checking if in correct folder... no"
exit 1;
else
- echo "checking for binary file... ok"
+ echo "checking if in correct folder... ok"
fi
if which dpkg >/dev/null; then
@@ -23,8 +25,9 @@ else
echo "checking for fakeroot... no"
exit 1;
fi
+
#creating of directories
-file=arbogen_$1_1
+
mkdir $file
mkdir -p $file/DEBIAN
mkdir -p $file/usr/bin
@@ -36,7 +39,7 @@ mkdir -p $file/usr/share/man/man1
#creation of text files
cat <<EOF > $file/DEBIAN/control
Package: arbogen
-Version: $1
+Version: `cat VERSION`
Section: ocaml
Priority: optional
Source: arbogen
@@ -49,10 +52,17 @@ EOF
cp doc/arbogen.1 $file/usr/share/man/man1/arbogen.1
gzip --best $file/usr/share/man/man1/arbogen.1
cp LICENSE.txt $file/usr/share/doc/arbogen/copyright
-cp arbogen $file/usr/bin/
+
+#compiling to create a executable.
+./compile.sh
+cp bin/arbogen $file/usr/bin/
+
chmod -R 755 $file
chmod a-x $file/usr/share/man/man1/arbogen.1.gz
chmod a-x $file/usr/share/doc/arbogen/copyright
#packaging
fakeroot dpkg-deb --build $file
+
+#cleaning up
+./cleanup.sh
View
22 debianBin_i386.sh
@@ -2,12 +2,12 @@
#debianBin.sh
#creates a binary debian package from source files
-
-if [ ! -f arbogen ]; then
- echo "checking for binary file... no"
+#testing if in correct folder
+if [ ! -f configure.in ]; then
+ echo "checking if in correct folder... no"
exit 1;
else
- echo "checking for binary file... ok"
+ echo "checking if in correct folder... ok"
fi
if which dpkg >/dev/null; then
@@ -24,7 +24,8 @@ else
exit 1;
fi
#creating of directories
-file=arbogen_$1_1
+file=arbogen_`cat VERSION`_1
+
mkdir $file
mkdir -p $file/DEBIAN
mkdir -p $file/usr/bin
@@ -36,7 +37,7 @@ mkdir -p $file/usr/share/man/man1
#creation of text files
cat <<EOF > $file/DEBIAN/control
Package: arbogen
-Version: $1
+Version: `cat VERSION`
Section: ocaml
Priority: optional
Source: arbogen
@@ -45,14 +46,21 @@ Maintainer: Frédéric Peschanski <Frederic.Peschanski@lip6.fr>
Description: Generates trees
Trees are generated randomly in different formats depending on grammar.
EOF
+
#placing files in correct place
cp doc/arbogen.1 $file/usr/share/man/man1/arbogen.1
gzip --best $file/usr/share/man/man1/arbogen.1
cp LICENSE.txt $file/usr/share/doc/arbogen/copyright
-cp arbogen $file/usr/bin/
+
+#compiling
+./compile.sh
+cp bin/arbogen $file/usr/bin/
chmod -R 755 $file
chmod a-x $file/usr/share/man/man1/arbogen.1.gz
chmod a-x $file/usr/share/doc/arbogen/copyright
#packaging
fakeroot dpkg-deb --build $file
+
+#clean up
+./cleanup.sh
View
2  opampackaging.sh
@@ -3,7 +3,7 @@
#creates an opam package
#the verision is passed as a parameter
-file=arbogen.$1
+file=arbogen.`cat VERSION`
mkdir $file
cat <<EOF > $file/descr
View
1  packaging.sh
@@ -1,7 +1,6 @@
#!/bin/sh
#packaging.sh
#creates an install package for using the files in its directory
-#the verision is passed as a parameter
pack=arbogen_`cat VERSION`
View
45 src/Makefile
@@ -1,45 +0,0 @@
-# where to install the binaries
-prefix=/usr/local
-exec_prefix=${prefix}
-BINDIR=${exec_prefix}/bin
-
-# where to install the man page
-MANDIR=${prefix}/share/man
-
-# other variables set by ./configure
-OCAMLC = ocamlc
-OCAMLOPT = ocamlopt
-OCAMLDEP = ocamldep
-OCAMLLEX = ocamllex
-OCAMLYACC= ocamlyacc
-OCAMLLIB = /usr/lib/ocaml
-OCAMLBEST= op
-
-SRCS = Options.ml Util.ml Grammar.ml CombSys.ml OracleSimple.ml Tree.ml Gen.ml GParser.ml ArboLib.ml Arbogen.ml
-TARGS = arbogen
-
-all: $(TARGS)
-
-arbogen: $(SRCS)
- $(OCAMLOPT) -o arbogen $(SRCS)
-
-arbogen.byte: $(SRCS)
- $(OCAMLC) -o arbogen.byte $(SRCS)
-
-
-install:: arbogen
- mkdir -p $(BINDIR)
- mv arbogen $(BINDIR)
- mkdir -p $(MANDIR)/man1
- cp -f doc/$(TARGS).1 /usr/local/man/man1/$(TARGS).1
-
-clean:
- rm -f *~
- rm -f *.cmi
- rm -f *.cmx
- rm -f *.cmo
- rm -f *.o
-
-cleanall: clean
- rm -f arbogen
- rm -f arbogen.byte
Something went wrong with that request. Please try again.