source: freewrt/package/nut/Makefile@ c3bf348

Last change on this file since c3bf348 was 99cbe83, checked in by Thorsten Glaser <tg@…>, 19 years ago

the treebreaker ☺

overhaul the fetch'n'checksum system to be more bsd-like

  • make fetch, make checksum supported
  • future expansion possibilities already prepared: – more distfiles than just one – check sizes of downloaded files (size matters!!!!!111) – more hashes than just MD5 – recursive fetch/checksum targets – PERMIT_{SOURCES,DISTFILES}=Yes/«reason» – licence issues
  • download.pl dies

quirks:

  • GNU make only has a poor excuse for a .for loop
  • some things (esp. toolchain and target/linux) now have a ${WRKDIR} where they didn't have it before
  • ${WRKDIR}/.checksum_done – no comment… it was necessary because otherwise everything will get rebuilt every time (did I mention that GNU make sucks?)
  • I had troubles tracking the dependency problems down because GNU make, unlike BSD make, doesn't have good debugging
  • DISTFILES -> FULLDISTFILES
  • DL_DIR -> DISTDIR
  • PKG_SOURCE -> DISTFILES
  • PKG_SOURCE_URL -> MASTER_SITES
  • no @SF and @GNU any more, use BSD network.template syntax (feel free to add more master sites)
  • GNU make doesn't really strip whitespaces from variables… (did I mention how much better BSD make is?)
  • echo 'LOCAL_DISTFILES=/path/to/distfiles' >>${TOPDIR}/prefs.mk will save the need to download 'em, Closes: #102
  • MASTER_SITES now *must* have the trailing slashes (there may be a few that don't and a few with double ones, please fix them)

I've tested that a normal build (unchanged .config from the default) works
on GNU/Linux. There's definitively room for improvement, but most of that
will come with the NFO system only. Fixes appreciated.

This work sponsored by AurISP, part of the NFO conversion project ☻

git-svn-id: svn://www.freewrt.org/trunk/freewrt@2678 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 4.1 KB
Line 
1# $FreeWRT$
2#-
3# This file is part of the FreeWRT project. FreeWRT is copyrighted
4# material, please see the LICENCE file in the top-level directory
5# or at http://www.freewrt.org/licence for details.
6
7include ${TOPDIR}/rules.mk
8
9PKG_NAME:= nut
10PKG_VERSION:= 2.0.4
11PKG_RELEASE:= 5
12PKG_MD5SUM:= 59b6f3038a5ef64c584913e72bd850a2
13MASTER_SITES:= http://www.networkupstools.org/source/2.0/
14
15include ${TOPDIR}/mk/package.mk
16
17$(eval $(call PKG_template,NUT,nut,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
18
19define DRIVER_template
20
21DRIVERS_$${FWRT_PACKAGE_NUT_DRIVER_${1}}+=${2}
22
23endef
24
25DRIVERS_y:=
26$(eval $(call DRIVER_template,BESTUPS,bestups))
27$(eval $(call DRIVER_template,FENTONUPS,fentonups))
28$(eval $(call DRIVER_template,APCSMART,apcsmart))
29$(eval $(call DRIVER_template,EVERUPS,everups))
30$(eval $(call DRIVER_template,BELKIN,belkin))
31$(eval $(call DRIVER_template,MASTERGUARD,masterguard))
32$(eval $(call DRIVER_template,POWERCOM,powercom))
33$(eval $(call DRIVER_template,CYBERPOWER,cyberpower))
34$(eval $(call DRIVER_template,TRIPPLITE,tripplite))
35$(eval $(call DRIVER_template,VICTRONUPS,victronups))
36$(eval $(call DRIVER_template,GENERICUPS,genericups))
37$(eval $(call DRIVER_template,MGE_UTALK,mge-utalk))
38$(eval $(call DRIVER_template,BESTUFERRUPS,bestuferrups))
39$(eval $(call DRIVER_template,ISBMEX,isbmex))
40$(eval $(call DRIVER_template,ETAPRO,etapro))
41$(eval $(call DRIVER_template,LIEBERT,liebert))
42$(eval $(call DRIVER_template,SMS,sms))
43$(eval $(call DRIVER_template,ESUPSSMART,esupssmart))
44$(eval $(call DRIVER_template,TRIPPLITESU,tripplitesu))
45$(eval $(call DRIVER_template,BLAZER,blazer))
46$(eval $(call DRIVER_template,SAFENET,safenet))
47$(eval $(call DRIVER_template,BELKINUNV,belkinunv))
48$(eval $(call DRIVER_template,ONEAC,oneac))
49$(eval $(call DRIVER_template,IPPON,ippon))
50$(eval $(call DRIVER_template,CPSUPS,cpsups))
51$(eval $(call DRIVER_template,MUSTEK,mustek))
52$(eval $(call DRIVER_template,METASYS,metasys))
53$(eval $(call DRIVER_template,BESTFCOM,bestfcom))
54$(eval $(call DRIVER_template,POWERMUST,powermust))
55$(eval $(call DRIVER_template,UPSCODE2,upscode2))
56$(eval $(call DRIVER_template,SOLIS,solis))
57$(eval $(call DRIVER_template,GAMATRONIC,gamatronic))
58$(eval $(call DRIVER_template,MEGATEC,megatec))
59$(eval $(call DRIVER_template,RHINO,rhino))
60
61CONFIG_DRIVERS=$(shell echo ${DRIVERS_y} | tr ' ' ',')
62
63INSTALL_DRIVERS_tmp=${DRIVERS_y}
64ifneq (${FWRT_PACKAGE_NUT_USB},)
65INSTALL_DRIVERS_tmp+= hidups energizerups
66endif
67ifneq (${FWRT_PACKAGE_NUT_SNMP},)
68INSTALL_DRIVERS_tmp+= snmp-ups
69endif
70INSTALL_DRIVERS=$(shell echo ${INSTALL_DRIVERS_tmp} | tr ' ' ',')
71
72CONFIGURE_STYLE:= gnu
73CONFIGURE_ARGS+= --with-linux-hiddev=${LINUX_DIR}/include/linux/hiddev.h \
74 --without-cgi \
75 --with-drivers=${CONFIG_DRIVERS} \
76 --with-user=root
77IPKG_DEPEND_tmp:=
78ifneq (${FWRT_PACKAGE_NUT_SSL},)
79CONFIGURE_ARGS+= --with-ssl
80CONFIGURE_ENV+= CPPFLAGS="${TCPPFLAGS} ${TLDFLAGS}"
81MAKE_FLAGS+= SSL_CFLAGS="${TCPPFLAGS}" SSL_LDFLAGS="${TLDFLAGS} -lssl -lcrypto"
82IPKG_DEPEND_tmp+= libopenssl
83endif
84BUILD_STYLE:= auto
85ALL_TARGET:= all
86INSTALL_STYLE:= auto
87INSTALL_TARGET:= install
88ifneq (${FWRT_PACKAGE_NUT_USB},)
89MAKE_FLAGS+= LIBUSB_CFLAGS="${TCPPFLAGS}" \
90 USB_DRIVER_LIST="newhidups tripplite_usb hidups energizerups"
91ALL_TARGET+= usb
92INSTALL_TARGET+= install-usb
93IPKG_DEPEND_tmp+= libusb
94endif
95ifneq (${FWRT_PACKAGE_NUT_SNMP},)
96ALL_TARGET+= snmp
97INSTALL_TARGET+= install-snmp
98IPKG_DEPEND_tmp+= libnetsnmp
99endif
100IPKG_DEPEND=$(shell echo ${IPKG_DEPEND_tmp} | tr ' ' ',')
101
102post-install:
103 ${INSTALL_DIR} ${IDIR_NUT}/usr/{s,}bin
104 ${INSTALL_DIR} ${IDIR_NUT}/etc/init.d
105 ${INSTALL_BIN} ./files/upsd.init \
106 ${IDIR_NUT}/etc/init.d/upsd
107 ${INSTALL_BIN} ${WRKINST}/usr/sbin/ups{d,mon,sched} \
108 ${IDIR_NUT}/usr/sbin/
109 ${INSTALL_BIN} ${WRKINST}/usr/bin/{${INSTALL_DRIVERS}} \
110 ${IDIR_NUT}/usr/bin/
111 ${INSTALL_BIN} ${WRKINST}/usr/bin/ups{c,cmd,drvctl,log,rw} \
112 ${IDIR_NUT}/usr/bin/
113 ${INSTALL_DATA} ./files/ups{d,}.conf ${IDIR_NUT}/etc/
114 echo "Depends: ${IPKG_DEPEND}" >> ${IDIR_NUT}/CONTROL/control
115ifneq (${FWRT_PACKAGE_NUT_VARDESC},)
116 ${INSTALL_DIR} ${IDIR_NUT}/usr/share
117 ${INSTALL_DATA} ${WRKINST}/usr/share/cmdvartab \
118 ${IDIR_NUT}/usr/share/
119endif
120
121include ${TOPDIR}/mk/pkg-bottom.mk
Note: See TracBrowser for help on using the repository browser.