summaryrefslogtreecommitdiff
path: root/media-gfx/jhead/files/jhead-3.06.0.1-mkstemp-fix-makefile.patch
blob: d25323d4ab3887c645886cb6c754cfa5742c84ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
diff -ruN jhead-3.06.0.1.orig/jhead.c jhead-3.06.0.1/jhead.c
--- jhead-3.06.0.1.orig/jhead.c	2021-04-14 14:02:45.000000000 +0200
+++ jhead-3.06.0.1/jhead.c	2022-10-09 00:25:03.812585996 +0200
@@ -377,7 +377,7 @@
     // as mktemp - that is, that between getting the random name, and making the file
     // some other program could snatch that exact same name!
     // also, not all platforms support mkstemp.
-    mktemp(TempName);
+    mkstemp(TempName);
 
 
     if(!TempName[0]) {
diff -ruN jhead-3.06.0.1.orig/makefile jhead-3.06.0.1/makefile
--- jhead-3.06.0.1.orig/makefile	2021-04-14 14:02:45.000000000 +0200
+++ jhead-3.06.0.1/makefile	2022-10-09 00:27:28.659543801 +0200
@@ -3,10 +3,14 @@
 #--------------------------------
 OBJ=obj
 SRC=.
-CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
-LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
+LFLAGS = -fPIC -shared -Wl,-soname,libjhead.so.1
 
-all: objdir jhead
+TARGET	= libjhead.so.1.0.0
+TARGET0	= libjhead.so
+TARGET1	= libjhead.so.1
+TARGET2 = libjhead.so.1.0
+
+all: objdir jhead $(TARGET)
 
 objdir:
 	@mkdir -p obj
@@ -15,7 +19,7 @@
 	$(OBJ)/exif.o $(OBJ)/iptc.o $(OBJ)/gpsinfo.o $(OBJ)/makernote.o 
 
 $(OBJ)/%.o:$(SRC)/%.c
-	${CC} $(CFLAGS) -c $< -o $@
+	${CC} -fPIC $(CFLAGS) -c $< -o $@
 
 jhead: $(objs) jhead.h
 	${CC} $(LDFLAGS) -o jhead $(objs) -lm
@@ -26,3 +30,9 @@
 install:
 	mkdir -p ${DESTDIR}/usr/bin/
 	cp jhead ${DESTDIR}/usr/bin/
+
+$(TARGET): $(objs) jhead
+	${CC} $(LDFLAGS) $(LFLAGS) -o $(TARGET) $(objs)
+	ln -s ${TARGET} ${TARGET0}
+	ln -s ${TARGET} ${TARGET1}
+	ln -s ${TARGET} ${TARGET2}