Skip to content

Commit e7ab226

Browse files
authored
Merge pull request #29 from kravemir/ddcpci-pkglibexecdir
2 parents 9424819 + 758ec37 commit e7ab226

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99

1010
### Changed
1111
- show warning message without blinking
12+
- install binary ddcpci to pkglibexec directory (it's not run by users)
1213

1314
## 0.4.3 - 2017-12-28
1415
### Removed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Clone, build and install built version:
4040
git clone https://github.com/ddccontrol/ddccontrol.git
4141
cd ddccontrol
4242
./autogen.sh
43-
./configure --prefix=/usr/
43+
./configure --prefix=/usr/ --libexecdir=/usr/lib
4444
make
4545
sudo make install
4646
```

configure.ac

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ fi
8181

8282
AC_DEFINE(_GNU_SOURCE, 1, [Define unconditionally for setting a GNU environment.])
8383

84-
CFLAGS="$CFLAGS -Wall -DDATADIR=\"\\\"${datadir}/ddccontrol-db\\\"\" -DBINDIR=\"\\\"${bindir}\\\"\""
84+
CFLAGS="$CFLAGS -Wall -DDATADIR=\"\\\"${datadir}/ddccontrol-db\\\"\" -DBINDIR=\"\\\"${bindir}\\\"\" -DPKGLIBEXECDIR=\"\\\"${pkglibexecdir}\\\"\""
85+
8586

8687
# Check for extra libraries
8788

src/ddcpci/Makefile.am

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/src/lib -DLOCALEDIR=\"$(localedir)\"
22

3-
bin_PROGRAMS = ddcpci
3+
# install to libexec, because it's not intended to be run by user
4+
pkglibexec_PROGRAMS = ddcpci
5+
46
ddcpci_LDFLAGS = -Wl,-z,now
57
ddcpci_SOURCES = main.c nvidia.c radeon.c i2c-algo-bit.c intel810.c ddcpci.h i2c-algo-bit.h via.c sis.c
68

79
EXTRA_DIST = intel740.c
810

911
install-exec-hook:
10-
chmod 4711 ${DESTDIR}/${bindir}/ddcpci
12+
chmod 4711 ${DESTDIR}/${pkglibexecdir}/ddcpci

src/lib/ddcci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ int ddcpci_init()
142142
printf("ddcpci initing...\n");
143143
}
144144

145-
key_t key = ftok(BINDIR "/ddcpci", getpid());
145+
key_t key = ftok(PKGLIBEXECDIR "/ddcpci", getpid());
146146

147147
if ((msqid = msgget(key, IPC_CREAT | 0666)) < 0) {
148148
perror(_("Error while initialisating the message queue"));
@@ -151,7 +151,7 @@ int ddcpci_init()
151151

152152
char buffer[256];
153153

154-
snprintf(buffer, 256, BINDIR "/ddcpci %d %d &", verbosity, key);
154+
snprintf(buffer, 256, PKGLIBEXECDIR "/ddcpci %d %d &", verbosity, key);
155155

156156
if (verbosity) {
157157
printf("Starting %s...\n", buffer);

0 commit comments

Comments
 (0)