coffin

secure lan file storage on a device
git clone git://parazyd.org/coffin.git
Log | Files | Refs | Submodules | README | LICENSE

Makefile (2540B)


      1 # coffin
      2 # see LICENSE file for copyright and license details
      3 
      4 include config.mk
      5 
      6 
      7 BIN = \
      8 	tomb-kdb-pbkdf2 \
      9 	tomb-kdb-pbkdf2-getiter \
     10 	tomb-kdb-pbkdf2-gensalt \
     11 	tomb-kdb-hexencode
     12 
     13 OBJ = ${BIN:=.o}
     14 SRC = ${BIN:=.c}
     15 
     16 all: options tomb
     17 	@sed -i 's:^DAEMON=.*:DAEMON=${DESTDIR}${PREFIX}/coffin/bin/coffin:' \
     18 		extra/coffin-initd
     19 	@sed -i 's:^path+=.*:path+=(${DESTDIR}${PREFIX}/coffin/bin):' \
     20 		sacrist
     21 	@sed -i -e 's:^		SSLCertificateFile.*:		SSLCertificateFile ${DESTDIR}${PREFIX}/coffin/share/coffin.pem:' \
     22 	        -e 's:^		SSLCertificateKeyFile.*:		SSLCertificateKeyFile ${DESTDIR}${PREFIX}/coffin/share/coffin.key:' \
     23 		extra/dav_apache
     24 
     25 options:
     26 	@echo coffin build options:
     27 	@echo "CFLAGS  = ${CFLAGS}"
     28 	@echo "LDFLAGS = ${LDFLAGS}"
     29 	@echo "CC      = ${CC}"
     30 
     31 .o:
     32 	@${CC} ${LDFLAGS} -o $@ $< ${LDLIBS}
     33 
     34 .c.o:
     35 	@echo CC $<
     36 	@${CC} ${CFLAGS} -o $@ -c $<
     37 
     38 ${OBJ}: config.mk
     39 
     40 tomb: ${BIN} ${OBJ}
     41 	@sed -i 's:^path+=.*:path+=( /sbin /usr/sbin ${DESTDIR}${PREFIX}/coffin/bin ):' \
     42 		tomb
     43 
     44 clean:
     45 	@echo cleaning
     46 	@rm -f ${BIN} ${OBJ}
     47 	@sed -i 's:^DAEMON=.*:DAEMON=:' \
     48 		extra/coffin-initd
     49 	@sed -i 's:^path+=.*:path+=():' \
     50 		sacrist
     51 	@sed -i -e 's:^		SSLCertificateFile.*:		SSLCertificateFile:' \
     52 	        -e 's:^		SSLCertificateKeyFile.*:		SSLCertificateKeyFile:' \
     53 		extra/dav_apache
     54 	@sed -i 's:^path+=.*:path+=( /sbin /usr/sbin ):' \
     55 		tomb
     56 
     57 dist: clean
     58 	@echo creating dist tarball
     59 	@mkdir -p coffin-${VERSION}
     60 	@cp -f coffin config.mk LICENSE Makefile README.md \
     61 		sacrist tomb ${SRC} coffin-${VERSION}
     62 	@cp -r zlibs helpers zuper extra coffin-${VERSION}
     63 	@rm -f coffin-${VERSION}/zuper/.git
     64 	@tar -cf coffin-${VERSION}.tar coffin-${VERSION}
     65 	@gzip coffin-${VERSION}.tar
     66 	@rm -rf coffin-${VERSION}
     67 
     68 install: all
     69 	@echo installing coffin to ${DESTDIR}${PREFIX}
     70 	@mkdir -p ${DESTDIR}${PREFIX}/coffin
     71 	@mkdir ${DESTDIR}${PREFIX}/coffin/bin
     72 	@mkdir ${DESTDIR}${PREFIX}/coffin/share
     73 	@cp -f coffin sacrist tomb ${BIN} ${DESTDIR}${PREFIX}/coffin/bin/
     74 	@cp -rf zlibs zuper ${DESTDIR}${PREFIX}/coffin/share/
     75 	@echo installing features
     76 	@./extra/setup_features.sh install ${FEATURES}
     77 	@cp -f extra/coffin.key ${DESTDIR}${PREFIX}/coffin/share/
     78 	@cp -f extra/coffin.pem ${DESTDIR}${PREFIX}/coffin/share/
     79 	@echo installing initscript
     80 	@cp -f extra/coffin-initd /etc/init.d/coffin
     81 
     82 
     83 uninstall:
     84 	@echo removing coffin from ${DESTDIR}${PREFIX}
     85 	@rm -rf ${DESTDIR}${PREFIX}/coffin
     86 	@rm -f /etc/init.d/coffin
     87 	@echo uninstalling features
     88 	@./extra/setup_features.sh uninstall ${FEATURES}
     89 
     90 .PHONY: all options tomb clean dist install uninstall