-
Notifications
You must be signed in to change notification settings - Fork 38
/
Makefile.am
293 lines (229 loc) · 8.94 KB
/
Makefile.am
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
AUTOMAKE_OPTIONS = foreign subdir-objects
SUBDIRS = . po
CLEANFILES =
DISTCHECK_CONFIGURE_FLAGS = --with-tests=yes
dbusservicedir = $(sysconfdir)/dbus-1/system.d
dbusservice_DATA = nm-ssh-service.conf
nmvpnservicedir = $(NM_VPN_SERVICE_DIR)
nmvpnservice_DATA = nm-ssh-service.name
plugindir = $(libdir)/NetworkManager
libexec_PROGRAMS =
if WITH_LIBNM_GLIB
# Install a file with full path to plugins for an old gnome-shell
# https://bugzilla.gnome.org/show_bug.cgi?id=693590
install-data-hook:
mkdir -p $(DESTDIR)$(sysconfdir)/NetworkManager/VPN
sed -e "1s|^|# This file is obsoleted by a file in $(NM_VPN_SERVICE_DIR)\n\n|" \
-e 's|[@]LIBEXECDIR[@]|$(libexecdir)|g' \
-e 's|[@]PLUGINDIR[@]|$(libdir)/NetworkManager|g' \
<$(srcdir)/nm-ssh-service.name.in \
>$(DESTDIR)$(sysconfdir)/NetworkManager/VPN/nm-ssh-service.name
uninstall-hook:
rm -f $(DESTDIR)$(sysconfdir)/NetworkManager/VPN/nm-ssh-service.name
endif
desktopfile = nm-ssh.desktop.in
iconfile = gnome-mime-application-x-ssh-settings.png
if WITH_GNOME
# FIXME: uncomment when nmce gets --import support
#desktopdir = $(datadir)/applications
#desktop_in_files = $(desktopfile)
#desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
#@INTLTOOL_DESKTOP_RULE@
#icondir = $(datadir)/icons/hicolor/48x48/apps
#icon_DATA = $(iconfile)
endif
appdatadir = $(datadir)/appdata
appdata_DATA = $(appdata_in_files:.xml.in=.xml)
appdata_in_files = appdata/network-manager-ssh.metainfo.xml.in
@INTLTOOL_XML_RULE@
nm-ssh-service.name: $(srcdir)/nm-ssh-service.name.in
sed -e 's|[@]LIBEXECDIR[@]|$(libexecdir)|g' \
-e 's|[@]PLUGINDIR[@]/|@NM_PLUGIN_DIR@|g' \
$< >$@
EXTRA_DIST = nm-ssh-service.name.in \
$(dbusservice_DATA) \
$(desktopfile) \
$(iconfile) \
$(appdata_in_files) \
$(appdata_DATA) \
properties/nm-ssh-dialog.ui \
properties/gresource.xml \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
\
shared/README \
shared/nm-service-defines.h \
shared/nm-default.h \
shared/nm-utils/nm-test-utils.h \
shared/nm-utils/nm-vpn-plugin-utils.c \
shared/nm-utils/gsystem-local-alloc.h \
shared/nm-utils/nm-shared-utils.h \
shared/nm-utils/nm-glib.h \
shared/nm-utils/nm-vpn-plugin-utils.h \
shared/nm-utils/nm-macros-internal.h \
shared/nm-utils/nm-vpn-plugin-macros.h \
shared/nm-utils/nm-shared-utils.c
CLEANFILES += $(nmvpnservice_DATA) \
$(desktop_DATA) \
$(appdata_DATA)
DISTCLEANFILES = intltool-extract intltool-merge intltool-update
ACLOCAL_AMFLAGS = -I m4
RPM_SOURCE_DIR = $(shell rpm --eval '%{_sourcedir}')
RPM_SPEC_DIR = $(shell rpm --eval '%{_specdir}')
PREPARE_SPEC = \
set -e; \
spec_file=`echo $(1)`; \
commit=`echo $(2)`; \
shortcommit=`echo $(3)`; \
checkout=`date --utc "+%Y%m%d"git`; \
changelog_date=`date --utc "+%a %b %d %Y"`; \
sed -i \
-e "s/___version___/$(VERSION)/g" \
-e "s/___commit___/$$commit/g" \
-e "s/___shortcommit___/$$shortcommit/g" \
-e "s/___checkout___/$$checkout/g" \
-e "s/___changelog_date___/$$changelog_date/g" \
$$spec_file
RPMBUILD_AND_VERIFY = \
set -e; \
spec_file=`echo $(1)`; \
tmp_build_log=`mktemp`; \
rpmbuild -ba $(RPM_SPEC_DIR)/$(PACKAGE).spec | tee $$tmp_build_log; \
rpms_to_verify=`grep '^Wrote:' $$tmp_build_log | cut -d: -f2 | xargs`; \
rm -f $$tmp_build_log; \
rpmlint -iv $$rpms_to_verify
changelog:
git log --format="* %cd %aN%n- (%h) %s%d%n" --date=local | sed -r 's/[0-9]+:[0-9]+:[0-9]+ //' > ChangeLog
rpm: changelog dist-gzip
@set -e; \
commit=`git log -n1 --format="%H"`; \
shortcommit=`git log -n1 --format="%h"`; \
mv $(distdir).tar.gz $(RPM_SOURCE_DIR)/$(PACKAGE)-$(VERSION)-$$shortcommit.tar.gz; \
cp $(PACKAGE).spec $(RPM_SPEC_DIR)/$(PACKAGE).spec; \
sed -i -e "s/%setup -q -n %{name}-%{commit}/%setup -q -n %{name}-%{version}/g" $(RPM_SPEC_DIR)/$(PACKAGE).spec; \
$(call PREPARE_SPEC, "$(RPM_SPEC_DIR)/$(PACKAGE).spec", $$commit, $$shortcommit); \
rpmbuild -ba $(RPM_SPEC_DIR)/$(PACKAGE).spec
git-rpm: changelog
@set -e; \
commit=`git log -n1 --format="%H"`; \
shortcommit=`git log -n1 --format="%h"`; \
wget -P $(RPM_SOURCE_DIR) \
-c https://github.com/danfruehauf/NetworkManager-ssh/archive/$$commit/NetworkManager-ssh-$(VERSION)-$$shortcommit.tar.gz; \
wget -P $(RPM_SPEC_DIR) \
-c https://raw.github.com/danfruehauf/NetworkManager-ssh/$$commit/NetworkManager-ssh.spec; \
$(call PREPARE_SPEC, "$(RPM_SPEC_DIR)/$(PACKAGE).spec", $$commit, $$shortcommit); \
$(call RPMBUILD_AND_VERIFY, "$(RPM_SPEC_DIR)/$(PACKAGE).spec")
deb: changelog dist-xz
@set -e; \
deb_src_filename=$(PACKAGE:NetworkManager%=network-manager%)_$(VERSION).orig.tar.xz; \
rm -rf debian/files debian/*.log debian/*.substvars \
debian/network-manager-ssh-gnome/ debian/network-manager-ssh/ debian/tmp/; \
mv $(distdir).tar.xz ../"$$deb_src_filename"; \
dpkg-buildpackage -B -nc
.PHONY: rpm deb changelog
AM_CPPFLAGS = \
$(LIBNM_CFLAGS) \
$(GIO_CFLAGS) \
-DNM_SSH_LOCALEDIR=\"$(datadir)/locale\" \
-I$(top_srcdir) \
-I$(top_srcdir)/shared/
libexec_PROGRAMS += nm-ssh-service
nm_ssh_service_SOURCES = \
src/nm-ssh-service.c \
src/nm-ssh-service.h \
shared/nm-service-defines.h
nm_ssh_service_LDADD = \
$(LIBNM_LIBS) $(GIO_LIBS)
properties/resources.c: properties/gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir)/properties --generate-dependencies $(srcdir)/properties/gresource.xml)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(srcdir)/properties --generate-source --internal
gtk4/resources.c: properties/gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies $(srcdir)/properties/gresource.xml |sed "s,^,$(builddir)/gtk4/,")
@mkdir -p $(builddir)/gtk4
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(srcdir)/gtk4 --sourcedir=$(builddir)/gtk4 --generate-source --internal
gtk4/%.ui: properties/%.ui
@mkdir -p $(builddir)/gtk4
gtk4-builder-tool simplify --3to4 $< |grep -v can-default >$@
# Include a prebuilt file in tarball, to avoid hitting
# https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4415
EXTRA_DIST += \
gtk4/nm-ssh-dialog.ui
###################################################################################################
plugin_LTLIBRARIES = properties/libnm-vpn-plugin-ssh.la
properties_libnm_vpn_plugin_ssh_la_SOURCES = \
shared/nm-utils/nm-vpn-plugin-utils.c \
shared/nm-utils/nm-vpn-plugin-utils.h \
properties/nm-ssh-editor-plugin.c \
properties/nm-ssh-editor-plugin.h
properties_libnm_vpn_plugin_ssh_la_CFLAGS = \
$(LIBNM_CFLAGS)
properties_libnm_vpn_plugin_ssh_la_LIBADD = \
$(LIBNM_LIBS)
properties_libnm_vpn_plugin_ssh_la_LDFLAGS = \
-avoid-version
###################################################################################################
if WITH_GNOME
plugin_LTLIBRARIES += properties/libnm-gtk3-vpn-plugin-ssh-editor.la
endif
properties_libnm_gtk3_vpn_plugin_ssh_editor_la_SOURCES = \
properties/nm-ssh-editor.c \
properties/nm-ssh-editor.h \
properties/advanced-dialog.c \
properties/advanced-dialog.h
nodist_properties_libnm_gtk3_vpn_plugin_ssh_editor_la_SOURCES = \
properties/resources.c
properties_libnm_gtk3_vpn_plugin_ssh_editor_la_CFLAGS = \
$(GTK_CFLAGS) \
$(LIBNM_CFLAGS)
properties_libnm_gtk3_vpn_plugin_ssh_editor_la_LIBADD = \
$(GTK_LIBS) \
$(LIBNM_LIBS)
properties_libnm_gtk3_vpn_plugin_ssh_editor_la_LDFLAGS = \
-avoid-version
###################################################################################################
if WITH_GTK4
plugin_LTLIBRARIES += properties/libnm-gtk4-vpn-plugin-ssh-editor.la
endif
properties_libnm_gtk4_vpn_plugin_ssh_editor_la_SOURCES = \
$(properties_libnm_gtk3_vpn_plugin_ssh_editor_la_SOURCES)
nodist_properties_libnm_gtk4_vpn_plugin_ssh_editor_la_SOURCES = \
gtk4/resources.c
properties_libnm_gtk4_vpn_plugin_ssh_editor_la_CFLAGS = \
$(GTK4_CFLAGS) \
$(LIBNM_CFLAGS)
properties_libnm_gtk4_vpn_plugin_ssh_editor_la_LIBADD = \
$(GTK4_LIBS) \
$(LIBNM_LIBS)
properties_libnm_gtk4_vpn_plugin_ssh_editor_la_LDFLAGS = \
$(properties_libnm_gtk3_vpn_plugin_ssh_editor_la_LDFLAGS)
###################################################################################################
if WITH_LIBNM_GLIB
plugin_LTLIBRARIES += properties/libnm-ssh-properties.la
endif
properties_libnm_ssh_properties_la_SOURCES = \
$(properties_libnm_gtk3_vpn_plugin_ssh_editor_la_SOURCES) \
$(libnm_vpn_plugin_ssh_la_SOURCES)
properties_libnm_ssh_properties_la_CFLAGS = \
-DNM_SSH_OLD \
$(LIBNM_GLIB_CFLAGS)
properties_libnm_ssh_properties_la_LIBADD = \
$(GTK_LIBS) \
$(LIBNM_GLIB_LIBS)
properties_libnm_ssh_properties_la_LDFLAGS = \
$(libnm_vpn_plugin_ssh_la_LDFLAGS)
###################################################################################################
libexec_PROGRAMS += auth_dialog/nm-ssh-auth-dialog
auth_dialog_nm_ssh_auth_dialog_CPPFLAGS = \
$(GTK_CFLAGS) \
$(LIBSECRET_CFLAGS) \
$(LIBNM_CFLAGS) \
$(LIBNMA_CFLAGS) \
-I$(top_srcdir)/ \
-I$(top_srcdir)/shared/
auth_dialog_nm_ssh_auth_dialog_SOURCES = \
properties/resources.c \
auth-dialog/main.c
auth_dialog_nm_ssh_auth_dialog_LDADD = \
$(GTK_LIBS) \
$(LIBSECRET_LIBS) \
$(LIBNM_LIBS) \
$(LIBNMA_LIBS)