1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251
|
#!/usr/bin/make -f
export JAVA_HOME=/usr/lib/jvm/default-java
#package names
pkg-platform := platform13
pkg-lib-platform := libnb-$(pkg-platform)
libnb-platform-java := $(pkg-lib-platform)-java
libnb-platform-java-doc := $(pkg-lib-platform)-java-doc
libnb-platform-devel-java := libnb-platform-devel-java
# Included clusters
pkg-nb := netbeans
base-apisupport := apisupport3
base-ide := ide14
base-java := java5
base-nb := nb
base-platform := platform13
pkg-apisupport := libnb-$(base-apisupport)-java
pkg-ide := libnb-$(base-ide)-java
pkg-java := libnb-$(base-java)-java
NBDIR := /usr/share/netbeans
export JAVADIR := /usr/share/java
JH_JAR := jhall.jar
JSEARCH_JAR := jsearch.jar
NB_JH_JAR := jhall-2.0_05.jar
NB_JSEARCH_JAR := jsearch-2.0_05.jar
JAVADOC_WEBSITE := http://bits.netbeans.org/7.0/javadoc
NB_INSTALL_DIR := usr/share/netbeans
EXT_JAR_LINK_DIR := $(NB_INSTALL_DIR)/$(pkg-platform)/modules/ext/
LIB_DIR := $(NB_INSTALL_DIR)/$(pkg-platform)/lib/
INSTALL := dh_install -p
LINK := dh_link -p
NB_PLATFORM_BUILD_DIR := $(shell pwd)/nbbuild/netbeans/platform
DEB_UPSTREAM_VERSION = $(shell dpkg-parsechangelog | \
grep -e '^Version' | \
perl -pi -e 's/^Version:\s+(.*)\+dfsg\d+-\d+.*$$/$$1/')
# Defined function to be used to create symlinks
define symlink
mkdir -p $(dir $(2))
ln -sf $(1) $(2)
endef
%:
dh $@ --with javahelper
#link:
# $(shell awk 'NF==4 {printf("echo ln -sf %s %s/%s;\n",$$1,$$2,$$4)}' debian/linked-jars)
# $(shell awk 'NF==4 {printf("echo ln -sf %s nbbuild/netbeans/%s/%s;\n",$$1,$$3,$$4)}' debian/linked-jars)
override_dh_auto_build:
mkdir -p nbbuild/external/xhtml1-dtds
ln -sf /usr/share/xml/xhtml/schema/dtd/1.0/xhtml* nbbuild/external/xhtml1-dtds
ln -sf /usr/share/xml/entities/xhtml/xhtml* nbbuild/external/xhtml1-dtds
# link the required jars
$(shell awk 'NF==4 {printf("ln -sf %s %s/%s;\n",$$1,$$2,$$4)}' debian/linked-jars)
######## Remove services and org/eclipse/* from equinox osgi.jar#####################
# mkdir debian/jar_tmp; cd debian/jar_tmp; \
# jar -xf $(JAVADIR)/org.eclipse.osgi.jar; \
# rm -rf META-INF/services org/eclipse; \
# jar -cf ../../libs.osgi/external/osgi.core-4.2.jar ./*;
# rm -rf debian/jar_tmp
#TODO $(call symlink, /usr/share/ant/lib, o.apache.tools.ant.module/external/lib)
################################################################
# Build the Windows launcher
cd o.n.bootstrap/launcher/windows && LDFLAGS="" make .build-impl nbexec.exe
cd apisupport.harness/windows-launcher-src && LDFLAGS="" make
################################################################
# Build the ide. DISPLAY must be unset to avoid build failures.
unset DISPLAY; ant \
-Dpermit.jdk6.builds=true \
-Dbuild.compiler.deprecation=false \
-Dbuild.compiler.debug=false \
-Dext.binaries.downloaded=true \
-Dverify.checkout=false \
-Dcluster.config=basic \
-f nbbuild/build.xml build-nozip
################################################################
# Build javadoc package
ant \
-Dbuild.compiler.deprecation=false \
-Dbuild.compiler.debug=false \
-Dverify.checkout=false \
-Dallmodules= \
-Dcluster.config=platform \
-Dconfig.javadoc.cluster=$(pkg-base) \
-Djavadoc.docs.org-netbeans-api-java=$(JAVADOC_WEBSITE)/org-netbeans-api-java/ \
-Djavadoc.docs.org-netbeans-modules-project-ant=$(JAVADOC_WEBSITE)/org-netbeans-modules-project-ant/ \
-Djavadoc.docs.org-netbeans-modules-projectapi=$(JAVADOC_WEBSITE)/org-netbeans-modules-projectapi/ \
-f nbbuild/build.xml build-javadoc
# remove the zip files - we only want the extracted files
rm -f nbbuild/build/javadoc/*.zip
override_dh_auto_install:
# recreate links
$(shell awk 'NF==4 {printf("ln -sf %s nbbuild/netbeans/%s/%s;\n",$$1,$$3,$$4)}' debian/linked-jars)
# Install libraries
mh_installjar -plibnb-org-openide-util-java -l debian/pom/openide-util.xml \
nbbuild/netbeans/platform/lib/org-openide-util.jar
mh_installpom -plibnb-org-openide-util-java debian/pom/openide-util.xml
mh_installjar -plibnb-org-openide-util-lookup-java -l debian/pom/openide-util-lookup.xml \
nbbuild/netbeans/platform/lib/org-openide-util-lookup.jar
mh_installpom -plibnb-org-openide-util-lookup-java debian/pom/openide-util-lookup.xml
mh_installjar -plibnb-org-openide-modules-java -l debian/pom/openide-modules.xml \
nbbuild/netbeans/platform/lib/org-openide-modules.jar
mh_installpom -plibnb-org-openide-modules-java debian/pom/openide-modules.xml
mh_installjar -plibnb-absolutelayout-java -l debian/pom/AbsoluteLayout.xml \
nbbuild/netbeans/java/modules/ext/AbsoluteLayout.jar
mh_installpom -plibnb-absolutelayout-java debian/pom/AbsoluteLayout.xml
#
# Install Platform
echo > nbbuild/netbeans/platform/.noautoupdate
echo > nbbuild/netbeans/platform/.lastModified
$(INSTALL)$(libnb-platform-java) nbbuild/netbeans/platform/* $(NB_INSTALL_DIR)/$(pkg-platform)
$(INSTALL)$(libnb-platform-java) nbbuild/netbeans/platform/.noautoupdate $(NB_INSTALL_DIR)/$(pkg-platform)
$(INSTALL)$(libnb-platform-java) nbbuild/netbeans/platform/.lastModified $(NB_INSTALL_DIR)/$(pkg-platform)
$(LINK)$(libnb-platform-java) $(JAVADIR)/org-openide-util.jar $(LIB_DIR)/org-openide-util.jar
$(LINK)$(libnb-platform-java) $(JAVADIR)/org-openide-util-lookup.jar $(LIB_DIR)/org-openide-util-lookup.jar
$(LINK)$(libnb-platform-java) $(JAVADIR)/org-openide-modules.jar $(LIB_DIR)/org-openide-modules.jar
#
# Install devel package
rm -f nbbuild/netbeans/harness/antlib/$(NB_JSEARCH_JAR)
echo > nbbuild/netbeans/harness/.noautoupdate
echo > nbbuild/netbeans/harness/.lastModified
$(INSTALL)$(libnb-platform-devel-java) nbbuild/netbeans/harness/* $(NB_INSTALL_DIR)/harness
$(INSTALL)$(libnb-platform-devel-java) nbbuild/netbeans/harness/.noautoupdate $(NB_INSTALL_DIR)/harness
$(INSTALL)$(libnb-platform-devel-java) nbbuild/netbeans/harness/.lastModified $(NB_INSTALL_DIR)/harness
#
#Fixing permissions
chmod 0755 debian/$(libnb-platform-devel-java)/$(NB_INSTALL_DIR)/harness/launchers/app.sh
#
# Install IDE package files
echo > nbbuild/netbeans/ide/.noautoupdate
echo > nbbuild/netbeans/ide/.lastModified
# #all files are removed from lib because they are in dll formats
# rm -rf nbbuild/netbeans/$(base-ide)/modules/lib
$(INSTALL)$(pkg-ide) nbbuild/netbeans/ide/* $(NB_INSTALL_DIR)/$(base-ide)
$(INSTALL)$(pkg-ide) nbbuild/netbeans/ide/.noautoupdate $(NB_INSTALL_DIR)/$(base-ide)
$(INSTALL)$(pkg-ide) nbbuild/netbeans/ide/.lastModified $(NB_INSTALL_DIR)/$(base-ide)
# Install Java package files
echo > nbbuild/netbeans/java/.noautoupdate
echo > nbbuild/netbeans/java/.lastModified
# #all doc files are removed because they are in zip and jar formats
# rm -rf nbbuild/netbeans/java/docs
$(INSTALL)$(pkg-java) nbbuild/netbeans/java/* $(NB_INSTALL_DIR)/$(base-java)
$(INSTALL)$(pkg-java) nbbuild/netbeans/java/.noautoupdate $(NB_INSTALL_DIR)/$(base-java)
$(INSTALL)$(pkg-java) nbbuild/netbeans/java/.lastModified $(NB_INSTALL_DIR)/$(base-java)
# Link in Ant libraries and binaries
-rmdir debian/$(pkg-java)/$(NB_INSTALL_DIR)/$(base-java)/ant/lib
$(LINK)$(pkg-java) usr/share/ant/bin $(NB_INSTALL_DIR)/$(base-java)/ant/bin
$(LINK)$(pkg-java) usr/share/ant/etc $(NB_INSTALL_DIR)/$(base-java)/ant/etc
$(LINK)$(pkg-java) usr/share/ant/lib $(NB_INSTALL_DIR)/$(base-java)/ant/lib
# Link in AbsoluteLayout jar
-rm debian/$(pkg-java)/$(NB_INSTALL_DIR)/$(base-java)/modules/ext/AbsoluteLayout.jar
$(LINK)$(pkg-java) usr/share/java/AbsoluteLayout.jar $(NB_INSTALL_DIR)/$(base-java)/modules/ext/AbsoluteLayout.jar
#
# Install API support package files
echo > nbbuild/netbeans/apisupport/.noautoupdate
echo > nbbuild/netbeans/apisupport/.lastModified
$(INSTALL)$(pkg-apisupport) nbbuild/netbeans/apisupport/* $(NB_INSTALL_DIR)/$(base-apisupport)
$(INSTALL)$(pkg-apisupport) nbbuild/netbeans/apisupport/.noautoupdate $(NB_INSTALL_DIR)/$(base-apisupport)
$(INSTALL)$(pkg-apisupport) nbbuild/netbeans/apisupport/.lastModified $(NB_INSTALL_DIR)/$(base-apisupport)
# # Install Netbeans package files
echo > nbbuild/netbeans/nb/.noautoupdate
$(INSTALL)$(pkg-nb) nbbuild/netbeans/nb/* $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb
$(INSTALL)$(pkg-nb) nbbuild/netbeans/nb/.lastModified $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb
$(INSTALL)$(pkg-nb) nbbuild/netbeans/nb/.noautoupdate $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb
$(INSTALL)$(pkg-nb) nbbuild/netbeans/bin/* $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/bin
$(INSTALL)$(pkg-nb) nbbuild/netbeans/CREDITS.html usr/share/$(pkg-nb)
$(INSTALL)$(pkg-nb) nbbuild/netbeans/README.html usr/share/$(pkg-nb)
$(INSTALL)$(pkg-nb) nbbuild/netbeans/netbeans.css usr/share/$(pkg-nb)
$(LINK)$(pkg-nb) $(NB_INSTALL_DIR)/$(base-platform) $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/platform
$(LINK)$(pkg-nb) $(NB_INSTALL_DIR)/harness $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/harness
$(LINK)$(pkg-nb) $(NB_INSTALL_DIR)/$(base-apisupport) $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/apisupport
$(LINK)$(pkg-nb) $(NB_INSTALL_DIR)/$(base-ide) $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/ide
$(LINK)$(pkg-nb) $(NB_INSTALL_DIR)/$(base-java) $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/java
# Create file marker to avoid displaying license dialog at first IDE start
echo > debian/license_accepted
$(INSTALL)$(pkg-nb) debian/license_accepted $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb/var
# Install file productid used by autoupdate to report installation type
$(INSTALL)$(pkg-nb) debian/productid $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb/config
#
# Install netbeans.conf
$(INSTALL)$(pkg-nb) nbbuild/netbeans/etc/netbeans.conf etc
$(LINK)$(pkg-nb) etc/netbeans.conf $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/etc/netbeans.conf
#
# Install netbeans.clusters
$(INSTALL)$(pkg-nb) nbbuild/netbeans/etc/netbeans.clusters etc
$(LINK)$(pkg-nb) etc/netbeans.clusters $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/etc/netbeans.clusters
#
# # Save original version of netbeans.conf as postinst patches it
# #cp nbbuild/netbeans/etc/netbeans.conf nbbuild/netbeans/etc/netbeans.conf.orig
# #$(INSTALL)$(pkg-nb) nbbuild/netbeans/etc/netbeans.conf.orig $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/etc
#
# Install launcher
$(INSTALL)$(pkg-nb) nbbuild/netbeans/bin/netbeans usr/bin
# Install desktop file
$(INSTALL)$(pkg-nb) debian/netbeans.desktop usr/share/applications
override_dh_auto_clean:
-rm -f *.cdbs-config_list
-rm -f stamp-build-$(libnb-platform-java)
-rm -f stamp-build-$(libnb-platform-devel-java)
-rm -f stamp-build-$(libnb-platform-java-doc)
$(call symlink, $(JAVADIR)/$(JH_JAR), javahelp/external/$(NB_JH_JAR))
$(call symlink, $(JAVADIR)/$(JSEARCH_JAR), apisupport.harness/external/$(NB_JSEARCH_JAR))
ant -Dpermit.jdk6.builds=true -f nbbuild/build.xml clean
cd o.n.bootstrap/launcher/windows && make clean
cd apisupport.harness/windows-launcher-src && make clean
mh_clean
# remove all the symlinks to jar files we created
find . -name "*.jar" -type l -execdir rm -f \{\} \;
# -rm -f libs.osgi/external/osgi.core-4.2.jar
-rm -rf nbbuild/external/xhtml1-dtds
-rm -f nbbuild/nbproject/private/scan-cache-standard.ser
# -rm -f nbbuild/nbantext.jar
# -rm -rf debian/jar_tmp
-rm -f debian/license_accepted
# these files are not deleted by ant clean though it should so delete here
-rm -f swingapp/src/org/netbeans/modules/swingapp/resources/CRUDShellApp.zip
-rm -f swingapp/src/org/netbeans/modules/swingapp/resources/BasicShellApp.zip
# TODO - shouldn't have to do this
# -rm -rf */build
#
# -rm -f stamp-build-$(pkg-nb)
# -rm -f nbbuild/netbeans/platform
# -rm -f nbbuild/netbeans/harness
# -rm -f o.apache.tools.ant.module/external/lib
override_jh_depends:
# Skipping jh_depends run - since we use symlinks to /usr/share/java then
# jh_depends gets it wrong.
get-orig-source:
uscan --download-version $(subst +dfsg\d*,,$(DEB_UPSTREAM_VERSION)) --force-download
|