aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2021-02-10 21:23:24 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2021-02-10 21:23:24 +0100
commitd6f90a305d2ece6699f00ad19ae45d9fbc95bac8 (patch)
tree2a03be8bf5bab95733ea66fb79e498f2c1707a60
parentComments update (diff)
downloadlowbat-bsd-d6f90a305d2ece6699f00ad19ae45d9fbc95bac8.tar.gz
lowbat-bsd-d6f90a305d2ece6699f00ad19ae45d9fbc95bac8.tar.bz2
lowbat-bsd-d6f90a305d2ece6699f00ad19ae45d9fbc95bac8.tar.xz
lowbat-bsd-d6f90a305d2ece6699f00ad19ae45d9fbc95bac8.tar.zst
lowbat-bsd-d6f90a305d2ece6699f00ad19ae45d9fbc95bac8.zip
-rw-r--r--Makefile28
-rw-r--r--man/lowbat.130
2 files changed, 15 insertions, 43 deletions
diff --git a/Makefile b/Makefile
index a074287..5b3e460 100644
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,7 @@ A_SRCS_DIR = asm
PREFIX ?= /usr/local
BINPREFIX ?= ${PREFIX}/bin
MANPREFIX ?= ${PREFIX}/share/man
+RCPREFIX ?= ${PREFIX}/etc/rc.d
C_SRCS += ${C_SRCS_DIR}/n_speak.c
C_SRCS += ${C_SRCS_DIR}/n_notify.c
@@ -48,8 +49,6 @@ CFLAGS += -Wno-c99-extensions
CFLAGS += -Wno-variadic-macros
CFLAGS += -Werror
CFLAGS += -pedantic
-# CFLAGS += -O0 -glldb
-# CFLAGS += -fsanitize=address
CINCS += -I/usr/local/include
CINCS += -I/usr/local/include/glib-2.0
@@ -67,9 +66,6 @@ LDLIBS += -lc
TARGET = lowbat
AS = as
-# ASFLAGS = -f elf64
-# ASFLAGS += -p gas
-# ASFLAGS += -g
LDFLAGS ?=
LDLIBS = ${LDFLAGS}
@@ -78,16 +74,18 @@ LDLIBS += -lnotify
LDLIBS += -lespeak
SHELL := /bin/sh
-RM = rm -f
-MKDIR = mkdir -p
-CP = cp -pf
-MV = mv
-SED = sed
+RM := rm -f
+MKDIR := mkdir -p
+MV := mv
+SED := sed
+GZIP := gzip
+GUNZIP := gunzip
+INSTALL := install
.SUFFIXES: .S .c .S.o .c.o
.S.S.o:
- ${AS} ${ASFLAGS} -o ${.TARGET} ${.IMPSRC}
+ ${AS} -o ${.TARGET} ${.IMPSRC}
.c.c.o:
${CC} -c ${CFLAGS} ${CINCS} -o ${.TARGET} ${.IMPSRC}
@@ -106,9 +104,13 @@ all:
install: all
${MKDIR} "${DESTDIR}${BINPREFIX}"
- ${CP} ${TARGET} "${DESTDIR}${BINPREFIX}"
+ ${INSTALL} -m0555 ${TARGET} "${DESTDIR}${BINPREFIX}/${TARGET}"
+ ${GZIP} man/${TARGET}.1
${MKDIR} "${DESTDIR}${MANPREFIX}"/man1
- ${CP} man/${TARGET}.1 "${DESTDIR}${MANPREFIX}"/man1
+ ${INSTALL} -m0444 man/${TARGET}.1.gz "${DESTDIR}${MANPREFIX}"/man1/${TARGET}.1.gz
+ ${GUNZIP} man/${TARGET}.1.gz
+ ${MKDIR} "${DESTDIR}${RCPREFIX}"
+ ${INSTALL} -m0555 rc.d/${TARGET} "${DESTDIR}${RCPREFIX}/${TARGET}"
uninstall:
${RM} "${DESTDIR}${BINPREFIX}"/${TARGET}
diff --git a/man/lowbat.1 b/man/lowbat.1
index 149c62b..e69de29 100644
--- a/man/lowbat.1
+++ b/man/lowbat.1
@@ -1,30 +0,0 @@
-.\" Manpage for lowbat
-.\" Contact bousset.rudy@gmail.com to correct errors and typos.
-.TH lowbat 1 "29 Dec 2019" "lowbat 1.2" "Lowbat Reference"
-.SH NAME
-lowbat \- Lightweight battery warning utility
-.SH SYNOPSYS
-.B lowbat
-[\fB\-\-say\fR \fIMESSAGE\fR]
-.SH DESCRIPTION
-\fBlowbat\fR is a small program meant to be run as a daemon.
-It warns you using \fBnotify\-send\fR when your battery is falling under 15%.
-\fBlowbat\fR can send audio notifications using \fBespeak\fR with the \fB--say\fR option.
-.SH OPTIONS
-.TP
-.BR \-\-say =\fIMESSAGE\fR
-Sets a custom audio message.
-.SH TROUBLESHOOTING
-If \fBlowbat\fR fails to run correctly, you might be missing a dependency.
-To get run-time informations, simply run in a new terminal:
-.TP
-.in +.5i
-$ lowbat
-.SH AUTHOR
-Written by Joe <bousset.rudy@gmail.com>
-.SH REPORTING BUGS
-No known bugs. Bugs and suggestions should be reported on GitHub at https://github.com/JozanLeClerc/lowbat-bsd/issues
-.SH COPYRIGHT
-Copyright 2020 Joe, under the BSD license (see LICENSE for licensing informations)
-.SH SEE ALSO
-dunst(1), notify-send(1), espeak(1)