source: trunk/debian/package/debwrt-net/build.mk @ 292

Last change on this file since 292 was 292, checked in by amain, 8 years ago

debwrt-net package added: this package will contain all DebWrt networking configuration

File size: 2.5 KB
Line 
1# DebWrt - Debian on Embedded devices
2#
3# Copyright (C) 2010 Johan van Zoomeren <amain@debwrt.net>
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18PKG_NAME          = debwrt-net
19
20CH               := "[\(\)]"
21PKG_NAME_VERSION  = $(shell head -1 $(DEBIAN_PACKAGES_DIR)/$(PKG_NAME)/debian/changelog | awk '{gsub(/'$(CH)'/,"",$$2); print $$1"-"$$2}')
22DEBWRT_PKGLST    := $(DEBWRT_PKGLST) debian/package/$(PKG_NAME)
23run_in_chroot     = $(CHROOT_USER) bash -c "cd /usr/src/$(PKG_NAME); export ARCH=$(TARGET_ARCH); $(1)"
24
25debian/package/$(PKG_NAME): debian/package/$(PKG_NAME)/deliver
26        touch $@
27
28debian/package/$(PKG_NAME)/deliver: debian/package/$(PKG_NAME)/build
29        mkdir -p ${INSTALL_DIR_DEBIAN_PACKAGES}
30        cp -rav $(DEBIAN_BUILD_DIR)/usr/src/$(PKG_NAME)/*.deb ${INSTALL_DIR_DEBIAN_PACKAGES}
31        cp -rav $(DEBIAN_BUILD_DIR)/usr/src/$(PKG_NAME)/*.tar.gz ${INSTALL_DIR_DEBIAN_PACKAGES}
32        cp -rav $(DEBIAN_BUILD_DIR)/usr/src/$(PKG_NAME)/*.dsc ${INSTALL_DIR_DEBIAN_PACKAGES}
33        cp -rav $(DEBIAN_BUILD_DIR)/usr/src/$(PKG_NAME)/*.changes ${INSTALL_DIR_DEBIAN_PACKAGES}
34        touch $@
35
36debian/package/$(PKG_NAME)/build: debian/package/$(PKG_NAME)/prepare
37        $(call run_in_chroot,cd $(PKG_NAME_VERSION);dpkg-buildpackage -a${ARCH} -rfakeroot)
38        $(call run_in_chroot,find -maxdepth 1 -name "*.deb" | xargs -r -t -i sudo dpkg-cross -a ${TARGET_ARCH} -i {} || true)
39        touch $@
40
41debian/package/$(PKG_NAME)/prepare: debian/buildenv/create
42        rm -rf   $(DEBIAN_BUILD_DIR)/usr/src/$(PKG_NAME)
43        mkdir -p $(DEBIAN_BUILD_DIR)/usr/src/$(PKG_NAME)
44        mkdir -p $(DEBIAN_BUILD_DIR)/usr/src/$(PKG_NAME)/$(PKG_NAME_VERSION)
45        cp -ar $(DEBIAN_PACKAGES_DIR)/$(PKG_NAME)/* $(DEBIAN_BUILD_DIR)/usr/src/$(PKG_NAME)/$(PKG_NAME_VERSION)
46        rm -f $(DEBIAN_BUILD_DIR)/usr/src/$(PKG_NAME)/$(PKG_NAME_VERSION)/build.mk
47        touch $@
48
49debian/package/$(PKG_NAME)/clean:
50        rm -f debian/package/$(PKG_NAME)/build
51        rm -f debian/package/$(PKG_NAME)/prepare
52        rm -f debian/package/$(PKG_NAME)/deliver
53
Note: See TracBrowser for help on using the repository browser.