Permalink
Browse files

Add Makefile rules to create packages

Tar archives, RPM and DEB packages can be created. Note that I didn't
actually tested packages, rules or spec files might require some tuning.
  • Loading branch information...
tea committed Apr 21, 2009
1 parent fd76281 commit 064959919130e5b6628b74a6157414b3dc780c79
Showing with 122 additions and 5 deletions.
  1. +11 −0 .gitignore
  2. +11 −0 external/stuff/control.in
  3. +40 −0 external/stuff/e-rpm.spec.in
  4. +9 −0 linux-notes.txt
  5. +51 −5 src/Makefile
View
@@ -27,6 +27,17 @@ _ReSharper*
src/e
src/e.debug
+# Linux release stuff
+.deploy
+e-*.deb
+e-*.rpm
+e-*.tar.gz
+
+# ebundles
+external/stuff/Bundles
+external/stuff/Support
+external/stuff/Themes
+
## Ignore non-source-controlled things in external
# 'arch' contains downloaded dependency archives
external/arch/
View
@@ -0,0 +1,11 @@
+Package: e
+Version: %VERSION%-%RELEASE%
+Section: editors
+Priority: optional
+Architecture: all
+Essential: no
+Depends: gtk2, curl, sqlite3, libxml2, libxslt, libjpg, icu, cairo, openssl
+Installed-Size: 31000
+Maintainer: Alexander Stigsen [source@e-texteditor.com]
+Provides: AlexanderStigsen
+Description: e is a fast and elegant text editor with many innovative features.
@@ -0,0 +1,40 @@
+%define name e
+%define version %VERSION%
+%define release %RELEASE%
+%define deploy %DEPLOY%
+
+Summary: e text editor
+Name: e
+Version: %{version}
+Release: %{release}
+License: Commercial
+Group: Productivity/Editors/Other
+URL: http://www.e-editor.com/
+Vendor: Alexander Stigsen
+BuildRoot: %{deploy}
+Requires: curl
+Requires: gtk2
+Requires: sqlite3
+Requires: libxml2
+Requires: libxslt
+Requires: libjpg
+Requires: icu
+Requires: cairo
+Requires: openssl
+
+%description
+e is a fast and elegant text editor with many innovative features.
+
+%prep
+
+%post
+
+%files
+%defattr(755,root,root)
+%dir /opt/e
+/opt/e/e
+%attr(644,root,root)
+/opt/e/Bundles/*
+/opt/e/Support/*
+/opt/e/Themes/*
+
View
@@ -29,6 +29,15 @@ Packages required by WebKit:
- icu (ubuntu: libicu-dev)
- libjpeg (ubuntu: libjpeg62-dev)
+== Bundling e into tar.gz, rpm or deb packages
+
+1. Build e (release build) as described above
+2. Checkout ebundles tree as described in http://code.google.com/p/ebundles/source/checkout
+3. Export svn working tree into ./external/stuff (Bundles, Support and Themes directories must be present)
+4. To create tar.gz archive run make -C src tar
+5. To create RPM package run sudo make -C src rpm
+6. To create Deb package run make -C src deb
+
== Windows Files ==
These files do not compile, probably due to Windows dependencies:
View
@@ -1,43 +1,54 @@
VERBOSE=0
DEBUG=0
+VERSION=1.0
+RELEASE=31
+ROOTDIR=..
+
ifeq ($(VERBOSE),0)
ECHO=echo
SILENT=@
+ RPM_EXTRA=--quiet
else
ECHO=true
SILENT=
+ RPM_EXTRA=
endif
ifeq ($(DEBUG),0)
ECORE = ecore
CXXFLAGS = -O2
LDFLAGS =
- EXT_DIR = ../external/out.release
+ EXT_DIR = $(ROOTDIR)/external/out.release
OUTDIR = .objs.release
EXE = e
+ PKGSUFF =
else
ECORE = ecored
CXXFLAGS = -O0 -g
LDFLAGS = -g
- EXT_DIR = ../external/out.debug
+ EXT_DIR = $(ROOTDIR)/external/out.debug
OUTDIR = .objs.debug
EXE = e.debug
+ PKGSUFF = -debug
endif
+E_DEPLOY_DIR = $(ROOTDIR)/.deploy
+E_STUFF_DIR = $(ROOTDIR)/external/stuff
+
WXINCLUDES = $(shell $(EXT_DIR)/bin/wx-config --cppflags)
GTKINCLUDES = $(shell pkg-config --cflags gtk+-2.0 cairo pango atk glib-2.0)
OURINCLUDES = -I$(EXT_DIR)/include
-INCLUDES = $(WXINCLUDES) $(OURINCLUDES) $(GTKINCLUDES) -I../ecore -I.
+INCLUDES = $(WXINCLUDES) $(OURINCLUDES) $(GTKINCLUDES) -I$(ROOTDIR)/ecore -I.
OURLIBPATHS = -L$(EXT_DIR)/lib
WXLIBS = $(shell $(EXT_DIR)/bin/wx-config --libs)
WEBKIT_LIBS = -lwxwebkit -lwebcore-wx -ljscore
-LIBS = $(OURLIBPATHS) -L../ecore -l$(ECORE) -lcurl -ltomcrypt -ltommath -lmk4 -lpcre -ltinyxml $(WEBKIT_LIBS) $(WXLIBS)
+LIBS = $(OURLIBPATHS) -L$(ROOTDIR)/ecore -l$(ECORE) -lcurl -ltomcrypt -ltommath -lmk4 -lpcre -ltinyxml $(WEBKIT_LIBS) $(WXLIBS)
# Exceptions which do not need to be compiled on linux
EXCEPT = CygwinDlg.cpp \
@@ -57,7 +68,7 @@ EXTOBJS = $(shell $(EXT_DIR)/bin/wx-config --linkdeps) $(shell pkg-config --libs
CXXFLAGS += -Wall -fno-strict-aliasing -DHAVE_CONFIG_H -DFEAT_BROWSER -MD
-.PHONY: all clean
+.PHONY: all clean prep-tree tar rpm deb .test-stuff .FORCE
all: $(EXE)
@@ -73,5 +84,40 @@ $(OUTDIR)/%.o: %.cpp
clean:
rm -f $(OBJS) $(EXE) $(DEPS)
+.test-stuff: .FORCE
+ @$(ECHO) "[TEST] $(E_STUFF_DIR) contents"
+ $(SILENT)test -d $(E_STUFF_DIR) -a -d $(E_STUFF_DIR)/Themes -a -d $(E_STUFF_DIR)/Support
+ $(SILENT)test -d $(E_STUFF_DIR)/Bundles -a -d $(E_STUFF_DIR)/Bundles/Text.tmbundle
+
+prep-tree: $(EXE) .test-stuff
+ $(SILENT)rm -rf $(E_DEPLOY_DIR)
+ @$(ECHO) "[MKDIR] $(E_DEPLOY_DIR)/opt/e"
+ $(SILENT)mkdir -p $(E_DEPLOY_DIR)/opt/e
+ @$(ECHO) "[CP] $(EXE)"
+ $(SILENT)cp -f $(EXE) $(E_DEPLOY_DIR)/opt/e/e
+ifeq ($(DEBUG),0)
+ @$(ECHO) "[STRIP] $(EXE)"
+ $(SILENT)strip $(E_DEPLOY_DIR)/opt/e/e
+endif
+ @$(ECHO) "[CP] Bundles, Support and Themes from $(E_STUFF_DIR)"
+ $(SILENT)cp -Rf $(E_STUFF_DIR)/Bundles $(E_STUFF_DIR)/Support $(E_STUFF_DIR)/Themes $(E_DEPLOY_DIR)/opt/e
+
+tar: prep-tree
+ @$(ECHO) "[TAR] e-$(VERSION).$(RELEASE).tar.gz"
+ $(SILENT)tar -czf ../e-$(VERSION).$(RELEASE)$(PKGSUFF).tar.gz -C $(E_DEPLOY_DIR) opt/e
+
+rpm: prep-tree
+ $(SILENT)sed "s/%VERSION%/$(VERSION)/; s/%RELEASE%;$(RELEASE)/; s/%DEPLOY%/$(E_DEPLOY_DIR)/" \
+ $(E_STUFF_DIR)/e-rpm.spec.in > $(OUTDIR)/e-rpm.spec
+ @$(ECHO) "[RPMBUILD] $(OUTDIR)/e-rpm.spec"
+ $(SILENT)rpmbuild -bb $(RPM_EXTRA) $(OUTDIR)/e-rpm.spec
+ $(SILENT)cp /usr/src/packages/RPMS/*/e*rpm ../
+
+deb: prep-tree
+ $(SILENT)mkdir -p $(E_DEPLOY_DIR)/DEBIAN
+ $(SILENT)sed "s/%VERSION%/$(VERSION)/; s/%RELEASE%/$(RELEASE)/" $(E_STUFF_DIR)/control.in > $(E_DEPLOY_DIR)/DEBIAN/control
+ @$(ECHO) "[DPKG] $(E_DEPLOY_DIR)"
+ $(SILENT)dpkg -b $(E_DEPLOY_DIR) ../e-$(VERSION)-$(RELEASE)$(PKGSUFF).deb
+
-include $(DEPS)

0 comments on commit 0649599

Please sign in to comment.