Commit graph

491 commits

Author SHA1 Message Date
Thomas Haller 369446eae6 checkpatch: add "contrib/scripts/checkpatch-feature-branch.sh" script
This takes current HEAD branch, and finds all the commits what
are not on master or one of the nm-1-* branches, and runs
checkpatch.pl on each.

The use is to run checkpatch.pl on all patches of a feature
branch.
2018-10-22 13:19:15 +02:00
Thomas Haller a487d34fc4 contrib: make "contrib/fedora/REQUIRED_PACKAGES" executable script
It will be called by .gitlab-ci.yml to install the packages.
2018-10-22 13:19:15 +02:00
Thomas Haller 8221f824f3 checkpatch: complain about Emacs file variables in source code 2018-10-18 12:16:55 +02:00
Michael Biebl 90f71c0f99 systemd: don't make NetworkManager D-Bus activatable
If the NetworkManager daemon has been stopped manually we don't want it
to be autostarted by a client request.

[lkundrak@v3.sk: The auto-activation is probably more surprising than useful.
Services that need NetworkManager API should depend on NetworkManager service
directly.

I have no idea what purpose does the D-Bus service file serve nowadays,
but it looks rather hacky (really, activating /bin/false) and the comment
in it suggests that the autoactivating behavior was not intended anyway.
Debian has been shipping this for quite some time and no complains have been
heard.]

https://github.com/NetworkManager/NetworkManager/pull/230
2018-10-12 12:54:02 +02:00
Lubomir Rintel 0d3c6072f5 contrib/checkpatch: remove the first character off a diff
Otherwise the leading whitespace checks won't work on patches.
2018-10-07 15:46:02 +02:00
Lubomir Rintel 587f006690 contrib/checkpatch: check some more whitespace trouble 2018-10-07 15:46:02 +02:00
Lubomir Rintel 1d57aefa41 contrib/checkpatch: correctly separate indentation across hunks 2018-10-07 15:46:02 +02:00
Beniamino Galvani 295b9d5b81 contrib/rpm: support building with meson
Add support for building with meson, enabled by '--with meson' so that
we can regularly test the whole build+test+install procedure with
meson. I compared the RPM contents of NM, NM-libnm, NM-libnm-devel
packages and they match the autotools ones. It's also faster:

  $ time contrib/fedora/rpm/build_clean.sh -g -Q -f

  real    3m54.239s
  user    11m15.000s
  sys     1m28.456s

  $ time contrib/fedora/rpm/build_clean.sh -g -Q -f -w meson

  real    3m9.938s
  user    9m5.225s
  sys     1m4.392s
2018-09-28 17:25:46 +02:00
Beniamino Galvani 1f18783404 contrib/rpm: remove duplicate documentation
In NetworkManager-libnm-devel we ship the same documentation in two
different places:

 /usr/share/doc/NetworkManager-libnm-devel
 /usr/share/gtk-doc/html/NetworkManager

Remove the former, which was added in commit e01c17523a.

Also, remove the same documentation from NetworkManager-glib-devel
since it's already present in NetworkManager-libnm-devel.
2018-09-28 17:25:46 +02:00
Lubomir Rintel 66ddc92135 checkpatch: detect some whitespace errors
Vim's trademark.
2018-09-24 13:21:12 +02:00
Lubomir Rintel 298f698c9e build: disable ibft settings plugin by default 2018-09-18 17:40:47 +02:00
Lubomir Rintel 9f9609555d initrd: add configuration generator
nm-initrd-generator scans the command line for options relevant to network
configuration and creates configuration files for an early instance of
NetworkManager run from the initial ramdisk during early boot.
2018-09-18 17:40:47 +02:00
luz.paz 58510ed566 docs: misc. typos pt2
Remainder of typos found using `codespell -q 3 --skip="./shared,./src/systemd,*.po" -I ../NetworkManager-word-whitelist.txt` whereby whitelist consists of:
 ```
ans
busses
cace
cna
conexant
crasher
iff
liftime
creat
nd
sav
technik
uint
```

https://github.com/NetworkManager/NetworkManager/pull/205
2018-09-17 11:26:13 +02:00
Beniamino Galvani 63639f338f contrib/rpm: fix mode of ghost ifup/ifdown files
Set the execution bit on /usr/sbin/{ifup,ifdown} ghost files to match
the mode of same files installed by initscripts.

Otherwise, they will appear as changed according to rpm verify:

 .M.......  g /usr/sbin/ifdown
 .M.......  g /usr/sbin/ifup

when the alternatives mechanism is not in place.

 # ll /usr/sbin/if{up,down}
 -rwxr-xr-x. 1 root root 1651 Aug 24 06:23 /usr/sbin/ifdown
 -rwxr-xr-x. 1 root root 5010 Aug 24 06:23 /usr/sbin/ifup

https://bugzilla.redhat.com/show_bug.cgi?id=1626517
(cherry picked from commit d8a972c575)
2018-09-14 14:56:09 +02:00
Thomas Haller d1fecaa2d3 contrib/rpm: fix handling of --with test default
Seems rpmbuild does not honor the latest occurance with

  --with test --without test

to disable tests. Work around that.

Fixes: ad850c4f03
(cherry picked from commit cc8c207120)
2018-09-14 14:55:43 +02:00
Thomas Haller fd2e8179d3 contrib/rpm: disable tests by default and use fatal-warnings with tests
In general, when we build a package, we want no compiler warnings
and all unit tests to pass.

That is in particular true when building a package for the distribution
in koji. When builing in koji, we (rightly) cannot pass rpmbuild options, so
the default whether tests/compiler-warnings are fatal matter very much.

One could argue: let's have the tests/compiler-warnings fatal and fail the build.
During a build in koji for a Fedora release, we want them all pass. And if somebody
does a manual build, the person can patch the spec file (or use rpmbuild
flags).

However, note how commit "f7b5e48cdb contrib/rpm: don't force fatal warnings
with tests" already disabled fatal compiler warnings. Why? It seems
compiler warnings should be even more stable than our unit tests, as long
as you target a particular Fedora release and compiler version. So this
was done to support rebuilding an SRPM for a different Fedora release,
or to be more graceful during early development phase of a Fedora
release, where things are not as stable yet.

The exactly same reasoning applies to treating unit-tests failures as fatal.
For example, a recent iproute2 issue broke unit tests. That meant, with
that iproute2 release in build root, the NetworkManager RPM could not be built.
Very annoying.

Now:

- if "test" is enabled, that means both `make check` and compiler warnings
  are treated fatal. If "test" is disabled, `make check` and compiler
  warnings are still done, just not fatal.

- "test" is now disabled by default via the spec file. They are not fatal
  when building in koji or when rebuilding the package manually.

- tests can be enabled optionally. Note that the "build_clean.sh"
  script enables them by default. So, a user using this script would
  need to explicitly "--without test".

(cherry picked from commit ad850c4f03)
2018-09-14 14:08:19 +02:00
Thomas Haller 7e6824f4da contrib/rpm: always run tests and enable more compiler warnings in package build
- always enable more compiler warnings. They are not marked as breaking
  the build anyway.

- also, always build with '--with-tests=yes'. Note that our autotools is
  actually very nice. Even if you build '--with-tests=no', you still can
  run `make check` and the tests are build on demand. The only
  difference here is whether the tests are build during `make` or during
  `make check`. While little difference, build everything during the
  `make` step.

- when running tests, use `make -k check`. Even if they fail, we want to
  run the entire test suite.

- also running tests are disabled, still run them. But don't let them
  fail the build.

(cherry picked from commit 58b030f39a)
2018-09-14 14:08:18 +02:00
Thomas Haller 5f1912f579 contrib/rpm: add --release option to build_clean.sh script
The correct way to create a tarball for release is

  ./contrib/fedora/rpm/build_clean.sh -r

Just ensure to issue this from a clean shell environment.

(cherry picked from commit 5894da67dc)
2018-09-14 09:04:23 +02:00
Thomas Haller 5023e089c6 contrib/rpm: disable --with-more-asserts for devel-builds
The NetworkManager spec file used to determine devel builds as those that
have an odd minor version number. In that case, the built package would
enable more-asserts.
-- By the way, why is '1.13.3-dev' considered a delopment version worthy of more
asserts, but a build from the development phase of the next minor release on
'nm-1-12' branch not?

Note that during the development phase of Fedora (and sometimes even afterwards),
we commonly package development versions from 'master'. For example '1.12.0-0.1',
which is some snapshot with version number '1.11.x-dev' (or '1.12-rc1' in this case),
but before the actual '1.12.0' release.

It's problematic that for part of the devel phase we compile the
package for the distribution with more assertions. This package is
significanly different and rpmdiff and coverity give different results
for them.
For example, the binary size of debug packages is larger, so first
rpmdiff will complain that the binary sized increased (compare to the
previous version) and then later it decreases again.
Likewise, coverity finds significantly different issues on a debug
build. For example, it sees assertions against NULL and takes that
as a hint as to whether the parameter can/shall be NULL. Keeping
coverity warnings low is already high effort to sort out false
positives. We should not invest time in checking debug builds with
coverity, at least not as long as there are more important issues.

But more importantly, the --with-more-asserts configure option governs whether
nm_assert() is enabled. The only point of existance of nm_assert() -- compared to
g_assert(), g_return_*() and assert() -- is that this variant is disabled by default.
It's only used for checks that are really really not supposed to fail and/or
which may be expensive to do. This is useful for developing and CI,
but it's not right to put into the distribution. It really enables
assertions that you don't want in such a scenario. Enabling them even
for distribution builds defeats their purpose. If you care about an
assertion to be usually/always enabled, you should use g_assert() or
g_return_*() instead.

What this changes, that "devel" builds in koji/brew do not have more-asserts
enabled. When manually building the SRPM one still can enable it,
for example via

  $ ./contrib/fedora/rpm/build_clean.sh -w debug

Also our CI has an option to build packages with or without more-asserts
(defaulting to more asserts already).

(cherry picked from commit b4e2f83403)
2018-09-14 08:16:57 +02:00
Thomas Haller c25d54d0fd contrib/rpm: fix invalid %if condition for building on RHEL
Fixes: 5ef81dc0fb
2018-09-04 09:54:42 +02:00
Thomas Haller 5ef81dc0fb contrib/rpm: change default DHCP plugin to internal
... but keep "dhclient" on Fedora and RHEL <= 7.

https://bugzilla.redhat.com/show_bug.cgi?id=1571655
2018-09-03 21:23:47 +02:00
Lubomir Rintel d70185ddf1 all: point git references to the GitLab instance
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/2
2018-08-27 11:36:56 +02:00
Thomas Haller cf02b9c5df checkpatch.pl: complain about space in elvis operator ?: 2018-08-09 17:07:23 +02:00
Thomas Haller c8f2384210 contrib/rpm: enable connectivity_redhat only from rhel-8 onwards
There is no consensus, that this should be enabled on rhel-7 (yet).
2018-08-03 11:30:32 +02:00
Thomas Haller e028a53612 contrib/rpm: use %autosetup to simplify patch application
This allows us to omit the %patch1 macros.

See-also: http://rpm.org/user_doc/autosetup.html
2018-08-03 11:08:47 +02:00
Lubomir Rintel 0413704470 rpm: own /etc/sysconfig/network-scripts
We don't rely on initscripts. If they're gone, we still use the
directory.
2018-07-24 19:10:15 +02:00
Lubomir Rintel c40dbeb49a contrib/rpm: add RHEL connectivity checking package
https://github.com/NetworkManager/NetworkManager/pull/166
2018-07-23 12:30:25 +02:00
Lubomir Rintel 3f449654f7 contrib/rpm: use whitespace consistently
Double newline is used to visually separate sections.
2018-07-23 12:30:20 +02:00
Thomas Haller 3992856964 contrib/rpm: reorder BuildRequires in spec file
Move the BuildRequires related to basic C build environment to the
beginning. Also, avoid specifying multiple packages in one line.
2018-07-17 17:42:24 +02:00
Thomas Haller e2f106354e contrib/rpm: add BuildRequires to gcc compiler for NetworkManager.spec
Fedora is removing gcc from the default build-root [1], hence
require it.

Actually, we already have a "BuildRequires: libtool", which has a
dependancy on gcc and we already got it implicitly. Just make it
explicit.

[1] https://fedoraproject.org/wiki/Changes/Remove_GCC_from_BuildRoot
2018-07-17 17:42:24 +02:00
Javier Arteaga 6c3174f6e0 checkpatch: fix perldoc heading
The script does not actually emulate a serial modem (yet).

https://github.com/NetworkManager/NetworkManager/pull/165
2018-07-12 07:40:02 +02:00
Lubomir Rintel 7e98b4cad2 checkpatch: skip foreign code 2018-07-11 12:02:06 +02:00
Lubomir Rintel 2b152a69c4 checkpatch: add a licensing hint 2018-07-11 12:02:06 +02:00
Lubomir Rintel 26910ebdd7 checkpatch: reset line counter on next file 2018-07-11 12:02:06 +02:00
Thomas Haller 24082ad09e checkpatch: check against using "unsigned int" and "$INT_TYPE unsigned|signed"
Don't use the integer type before signed/unsigned, but the
other way around. That is,

    unsigned long var;

instead of

    long unsigned var;

Also, just use "unsigned" instead of "unsigned int".
2018-07-11 12:02:06 +02:00
Thomas Haller a9d81031f4 checkpatch: skip over generated files from glib-mkenums 2018-07-11 12:02:06 +02:00
Thomas Haller 2d28d5d5d4 checkpatch: warn about non-leading tabs
Tabs are not only wrong after a space, they are always
wrong if they don't appear at the beginning of a line.
That would happen usually, when trying to align multiple
lines like

  enum {
      VALUE1		= 1;
      OTHER_VALUE	= 2;
  };

When doing that, the alignment will only be correct, if the
reader later uses the same tab-width. Note that in NetworkManager
we recommend the tab-width to be 4 characters, but with our "smart
tab" indentation style, it wouldn't actually matter and the reader
is free to choose any other tab-width -- as long as we don't use
non-leading tabs.

Don't allow non-leading tabs.
2018-07-11 12:02:06 +02:00
Thomas Haller e82e2ca730 checkpatch: warn about using glib typedefs like gchar or gint
We should not use glib typedefs for basic C types char, short, int,
long, float or double. We commonly do not use them, so enforce
consistency.

That is not true for typedefs like guint, which we commonly use
because it's shorter typing than "unsigned int" (or "int unsigned"
or "unsigned"). Whether or not to use guint is left undecided at this
point.
2018-07-11 12:02:06 +02:00
Lubomir Rintel c866df7997 contrib/checkpatch: print the actual source name instead of patch name
This gives more relevant output in a commit check.

Include a couple of small fixes trivial enough not to deserve a separate
commit.
2018-07-10 13:32:04 +02:00
Lubomir Rintel 0f3f56695a contrib: add checkpatch.pl
A naive code compliance checker. Invoke directly:

  contrib/scripts/checkpatch.pl 0001-switch-comments-to-klingon.patch
  contrib/scripts/checkpatch.pl hello.[ch] world.c

Use from a commit hook:

  echo 'git format-patch --stdout -1 |contrib/scripts/checkpatch.pl || :>' \
      >.git/hooks/post-commit

Or view the documentation with "perldoc contrib/scripts/checkpatch.pl"
2018-07-10 12:41:37 +02:00
Timothy Redaelli 9be0c3330d contrib/rpm: Use Open vSwitch instead of OpenVSwitch
The correct naming is Open vSwitch so use it instead of OpenVSwitch

[lkundrak@v3.sk: added some more cases of the same]

https://github.com/NetworkManager/NetworkManager/pull/150

Fixes: 830a5a14cb
2018-06-28 20:31:32 +02:00
Lubomir Rintel e1db543b5b contrib: add a serial modem emulator
Useful for quickly testing the ModemManager integration.
2018-06-18 16:05:29 +02:00
Thomas Haller ea23010baa contrib/rpm: fix dependency for /sbin/update-alternatives
Fixes: 28d2c07661
2018-06-11 22:07:35 +02:00
Lubomir Rintel 28d2c07661 rpm: install alternative implementations of ifup/ifdown
Unless the initscripts package too old to allow alternatives is present,
install nmcli as an alternative implementation of ifup and ifdown.

The triggerin scriptlet allow us to do the right thing regardless of
which initscripts version is installed or even when it's upgraded.

The initscripts patch was included in Fedora 29:
https://github.com/fedora-sysv/initscripts/pull/197
2018-06-11 15:09:42 +02:00
Lubomir Rintel c28b334fdd rpm/build.sh: suggest dnf builddep after BUILDTYPE=SRPM
Convenient for copy & paste.
2018-05-28 11:44:02 +02:00
Lubomir Rintel de326a4e8a rpm: prefer python3
From Fedora 28 on we can build without Python 2. That is good,
because it's eventually going to be removed.

Based on a change in Fedora dist-git by Iryna Shcherbina.
2018-05-28 11:44:02 +02:00
Thomas Haller ebd61e1bc1 contrib/rpm: use gnutls crypto library instead of NSS on rhel-8 and fedora-29
https://bugzilla.redhat.com/show_bug.cgi?id=1581693
2018-05-24 11:36:00 +02:00
Lubomir Rintel 320422e4cf build: qualify plugin dir name with a version string
This makes package updates more robust, avoiding in-place replaces of
the plugins.

Previously, if an upgrade transaction was terminated, NetworkManager
library could end up being of a different version than the plugins.
If the user was unfortunate enough to connect using a connection that
required a plugin (say, Wi-Fi), he would be left without a network
connection making it somewhat inconvenient to recover from the botched
upgrade.

This makes the whole situation a little bit less sad.

The VPN plugins are kept where they always have been -- the path is not
qualified with a version number.
2018-05-14 16:05:12 +02:00
Lubomir Rintel bade13129b contrib/rpm: optionally depend on iwd
When built with iwd support, add an option to use iwd in place of
wpa_supplicant.

The "boolean dependencies" are only supported since RPM 4.13, with older
versions just keep things the way they were before.
2018-05-14 15:36:56 +02:00
Lubomir Rintel 62363ebc8f Revert "build: qualify plugin dir name with a version string"
This is broken -- looks for VPN plugins in a version-qualified path,
which is wrong and break installed VPN plugins.

This reverts commit 6384ad4ee1.
2018-05-11 10:41:50 +02:00
Lubomir Rintel 6384ad4ee1 build: qualify plugin dir name with a version string
This makes package updates more robust, avoiding in-place replaces of
the plugins.

Previously, if an upgrade transaction was terminated, NetworkManager
library could end up being of a different version than the plugins.
If the user was unfortunate enough to connect using a connection that
required a plugin (say, Wi-Fi), he would be left without a network
connection making it somewhat inconvenient to recover from the botched
upgrade.

This makes the whole situation a little bit less sad.
2018-05-09 12:59:39 +02:00
Thomas Haller 45fe57aea4 contrib/rpm: build config-connectivity-fedora package conditionally
On RHEL, we don't have NetworkManager-config-connectivity-fedora package.
Hence, the spec files for RHEL differ from upstream in this regard.

The aim is that contrib/rpm's spec file can be used almost as-is for
RHEL, Fedora and possibly other distros. Hence, build the subpackage
conditionally to minimize the difference.
2018-04-23 18:40:47 +02:00
Thomas Haller a187585222 contrib/nm-live-vm: remove nm-live-vm scripts
They were not (notably) touched in more than 3 years.
I doubt anybody is using them.

Also, nowadays we have contrib/rpm to build NetworkManager
packages for Fedora/RPM. We have copr, we have automated CI
in CentOS CI and beaker.

Also, nowadays it should be easy to spawn a a fedora image
in a container or tools like vagrant.

I think there are better alternatives. Drop the scripts.
2018-03-27 11:13:41 +02:00
Thomas Haller 3fab322a20 netlink: drop libnl3 dependency
From libnl3, we only used the helper function to parse/generate netlink
messages and the socket functions to send/receive messages. We don't
need an external dependency to do that, it is simple enough.

Drop the libnl3 dependency, and replace all missing code by directly
copying it from libnl3 sources. At this point, I mostly tried to
import the required bits to make it working with few modifications.

Note that this increases the binary size of NetworkManager by 4736 bytes
for contrib/rpm build on x86_64. In the future, we can simplify the code
further.

A few modifications from libnl3 are:

- netlink errors NLE_* are now in the domain or regular errno.
  The distinction of having to bother with two kinds of error
  number domains was annoying.

- parts of the callback handling is copied partially and unused parts
  are dropped. Especially, the verbose/debug handlers are not used.
  In following commits, the callback handling will be significantly
  simplified.

- the complex handling of seleting ports was simplified. We now always
  let kernel choose the right port automatically.
2018-02-21 12:08:46 +01:00
Thomas Haller 997cce7c90 build: fix glib dependency to require at least 2.40
Fixes: 8a46b25cfa
2018-02-16 13:26:07 +01:00
Beniamino Galvani f548806213 rpm: update sanitizer build flags
Disable undefined sanitizer on RHEL since it's not supported. Also,
enable address sanitizer only for executables, as having it enabled in
libraries causes problems when applications built without asan load
them.
2018-02-15 15:34:03 +01:00
Beniamino Galvani 0fb7989092 rpm: add requirements for sanitizer builds 2018-02-15 15:34:03 +01:00
Thomas Haller 3d41812945 contrib: add -h option to NM-log
Pass "-h" to highlight individual words.
"-h" stands for "highlight".

  $ NM-log -h wlan0 j
2018-02-12 13:06:49 +01:00
Thomas Haller 86a18b2df2 contrib/rpm: make "snapshot" for package version configurable via script
Will be used by CI trigger to name packages that are build during testing
of a github pull request with the corresponding pull request ID.

"build_clean.sh" now supports a command line option -s|--snapshot. But the
same paramter can also be set via $NM_BUILD_SNAPSHOT environment
variable. Using the environment variable is useful to support older versions
and new versions of "build_clean.sh", so that the script can just ignore the
snapshot setting if it doesn't understand it yet.
2018-02-09 17:35:19 +01:00
Lubomir Rintel f7b5e48cdb contrib/rpm: don't force fatal warnings with tests
It just doesn't make sense and just breaks stuff when nobody asked for
it.
2018-02-08 17:11:46 +01:00
Lubomir Rintel c4c8ffd113 contrib/rpm: build verbosely
The RPM build should be not use silent output -- it better be possible
to check whether the correct compiler flags were present at the build
time.
2018-02-08 17:11:46 +01:00
Thomas Haller 28da0154fc all: drop trailing spaces 2018-02-07 13:32:04 +01:00
Lubomir Rintel 8ba46ff4c6 rpm: disable libnm-glib for Fedora 29 and RHEL 8
While at it, move the API documentation to libnm-devel.
There doesn't seem to be a better place for it.
2018-01-16 12:15:51 +01:00
Thomas Haller 02a26de6f8 contrib/rpm: conditionally enable iwd Wi-Fi plugin 2017-12-27 09:18:54 +01:00
Thomas Haller 0474441e22 settings: drop unmaintained ifnet settings plugin of Gentoo
Even Gentoo disables this plugin since before 0.9.8 release
of NetworkManager. Time to say goodbye.

If somebody happens to show up to maintain it, we may resurrect it
later.

If "$distro_plugins=ifnet" was set, configure.ac would use that
to autodetect --with-hostname-persist=gentoo. Replace that autodetect
part by checking for /etc/gentoo-release file.
2017-12-21 10:50:33 +01:00
Thomas Haller 7573594a21 platform: merge nm_platform_*_delete() delete functions
It only makes sense to call delete() with NMPObjects that
we obtained from the platform cache. Otherwise, if we didn't
get it from the cache in the first place, we wouldn't know
what to delete.

Hence, the input argument is (almost) always an NMPObject
in the first place. That is different from add(), where
we might create a new specific NMPlatform* instance on the
stack. For add() it makes slightly more sense to have different
functions depending on the type. For delete(), it doesn't.
2017-12-11 10:30:26 +01:00
Thomas Haller b1c65d32fe Revert "Makefile: rework team compilation flags"
I don't think we should do this.

- renamining/dropping configure options is still an annoyance,
  because it requires to different ./configure options depending
  on the version. The rename from --enable-teamctl to --enable-team
  might be theoretically nice, but more annoying then helpful.

- There is no strict dependency between --enable-team and
  --enable-json-validation. At most, one could argue that
  when enabling the team plugin (--enable-teamctl), then
  libnm must also be build with --enable-json-validation.
  But in fact, the team plugin will happily work with a
  libnm that doesn't link against libjansson.
  That is --enable-teamctl --disable-json-validation will work
  in practice just fine.
  On the other hand, libnm is a client library to create connection
  profiles, fully supporting team profiles also makes sense if the
  actual plugin is not installed (or build). Thus, --disable-teamctl
  --enable-json-validation certainly makes sense.

At this point, one might ask whether libnm is even still complete without
libjansson. Maybe libnm should *require* --enable-json-validation.
But that is not what the patch was doing, and it would also need
some careful consideration before doing so.

This reverts commit 9d5cd7eae8.
2017-12-08 09:07:30 +01:00
Francesco Giudici 9d5cd7eae8 Makefile: rework team compilation flags
Rename the team functionality enablement from 'teamdctl' to 'team'.
Force jansson lib requirement for team functionality: NetworkManager
requires the teamd daemon to manage team. As teamd depends upon jansson
lib, adding jansson requirement for teaming support in NetworkManager
seems reasonable.
Remove the jansson_validation flag, as the only generic json function in
nmcli (not related to team) was the one to check if a string was in json
format. Anyway, that function is used for team checks only. So, move
also json validation functions under the WITH_TEAM flag.
2017-12-08 00:46:27 +01:00
Thomas Haller 8649fcf02a contrib: use less in NM-log to pre-process input
GNU less supports filters. That makes it nice to use instead of cat.
Also, less is well suited for output to a pipe.

With this, `NM-log nm-log.txt.gz` works as you would expect
2017-11-21 15:14:32 +01:00
Beniamino Galvani efe815737b contrib/rpm: fix builds without ovs support
Don't compile ovs support when the RPM is built --without=ovs, to fix
the following error:

error: Installed (but unpackaged) file(s) found:
   /usr/lib/systemd/system/NetworkManager.service.d/NetworkManager-ovs.conf
   /usr/lib64/NetworkManager/libnm-device-plugin-ovs.so
   /usr/share/man/man7/nm-openvswitch.7.gz

Fixes: 830a5a14cb
2017-11-02 11:54:18 +01:00
Lubomir Rintel 6b532fed50 man: add OpenVSwitch overview 2017-10-30 21:46:55 +01:00
Lubomir Rintel 830a5a14cb device: add support for OpenVSwitch devices 2017-10-30 21:46:55 +01:00
Murilo Opsfelder Araujo fa61e78d80 contrib/fedora: Add mockbuild.sh
This script comes handy to build from git tree without having to
install build dependencies on the system, the actual build happens
inside mock environment.

https://github.com/NetworkManager/NetworkManager/pull/34
2017-10-30 11:04:20 +01:00
juga0 3aba3e38c3 dhcp: add support for dhcpcanon client
https://github.com/NetworkManager/NetworkManager/pull/31
2017-10-30 10:43:10 +01:00
Murilo Opsfelder Araujo 301cf7151b contrib/fedora: Update required packages
Add dhclient and iptables packages to build dependencies to satisfy
rpmbuild complaints:

```
error: Failed build dependencies:
	dhclient is needed by NetworkManager-1:1.9.2-18653.43dba57439.fc28.x86_64
	iptables is needed by NetworkManager-1:1.9.2-18653.43dba57439.fc28.x86_64
ERROR: rpmbuild FAILED
```

https://github.com/NetworkManager/NetworkManager/pull/33
2017-10-25 18:08:34 +02:00
Thomas Haller 5a00811b5a contrib/rpm: explicitly set default dhcp configuration
It will also be autodetected, but be explicit about it.
2017-10-12 11:06:30 +02:00
Thomas Haller 102a58bb62 contrib/scripts: fix coloring for platform messages in NM-log for old logs
Older logfiles contain

  platform: route: adding or updating IPv4 route: 10.1.0

Hightlight that too.
2017-10-03 15:35:56 +02:00
Thomas Haller 513d0c2286 contrib/rpm: enable "NetworkManager-wait-online.service" on package upgrade
Since commit d61eaf2545 ("service: don't
install dependency for "NetworkManager-wait-online.service" to
"network-online.target.wants") we no longer install NM-w-o.service
in "network-online.target.wants" directory.

Obviously, for previous RPM versions NM-w-o.service was always enabled.
For current versions, it depends now on the preset. Most importantly,
this allows the user to disable the service, without masking it.
Previously NM-w-o.service was always implicitly enabled.

But presets are not applied during package upgrade, so it means that
after upgrade the service will be disabled. Hack around that via an RPM
scriptlet.

https://bugzilla.redhat.com/show_bug.cgi?id=1455704
2017-09-27 18:02:51 +02:00
Thomas Haller 18f53a8b30 contrib/scripts: update coloring for platform messages in NM-log (2)
Fixes: 9344013977
2017-09-25 18:36:08 +02:00
Thomas Haller 9344013977 contrib/scripts: update coloring for platform messages in NM-log 2017-09-25 15:13:02 +02:00
Thomas Haller 85e3f956ad contrib/rpm: update spec file with upstream source URL
This isn't useful for contrib/fedora/rpm itself because here
the __SOURCE__ gets set by the build scripts.

But this spec file is copied to Fedora downstream where the
SOURCE URL is used.
2017-09-20 14:29:53 +02:00
Thomas Haller 7d00a96d23 contrib/rpm: allow building RPM without fatal warnings
A newer compiler version might emit some warnings and break the build
of the RPM. Of course, such warnings must be fixed. But it is still very
inconvenient to break the build of an old RPM version without easy workaround.

When building without "test" (which is on by default), don't use fatal warnings
for compilation.
2017-09-11 14:22:10 +02:00
Thomas Haller 66a09b2192 contrib/NM-log: don't use exec in bash functions
When sourcing the file, using exec inside NM-show-journal is a bad idea,
because it replaces the calling shell.
2017-09-08 17:18:32 +02:00
Thomas Haller d4a5e2b1c8 contrib/NM-log: don't run less with --quit-on-intr argument
I find it annoying when ^C exits less and it prompts me to often
do `NM-log | less -R` instead.
2017-09-07 14:45:26 +02:00
Thomas Haller 83e2764050 contrib/NM-log: colorize warnings and errors in red (fix)
Must not colorize the trailing space, otherwise the following
" device" will no longer match.
2017-09-07 14:29:11 +02:00
Thomas Haller b20fc58b3c contrib/NM-log: colorize warnings and errors in red
- remove "\r\n" line endings
- colorize <warn> and <error> in red
- extend matching the info levels to include the timestamp. This
  (intentionally) will no longer highlight messages from ModemManager,
  which don't include a timestamp.
2017-09-07 14:24:56 +02:00
Thomas Haller cffde0101e contrib/NM-log: improve script and make it sourceable
- use "grep -a" so that grep doesn't refuse to work in binary input.
- make the script source-able to only define the NM-colorize and
  NM-show-journal
- In case the script is sourced, it also defines a NM-log function,
  which does the same as the script itself.
- rename internal functions so that they have names starting with "NM"
  in case of sourcing.
2017-09-07 14:04:13 +02:00
Thomas Haller 1fbd8c079c contrib/scripts: add NM-log helper
To pretty print and colorize NetworkManager logfiles.
2017-08-24 18:40:49 +02:00
Thomas Haller c528a89519 contrib/rpm: skip tests for -Q build option
Previously, the --quick option only mattered when creating
the source tarball, to run `make dist` instead of the slower
`make distcheck`.

Extend its meaning to also skip unit tests while building the RPM.
You still can enable them with

  $ ./contrib/fedora/rpm/build_clean.sh -Q -w test
2017-07-25 06:18:36 +02:00
Lubomir Rintel 1ac92ac355 contrib/rpm: provide NetworkManager-devel
The package no longer exists.

Fixes: 03586743f0
2017-07-21 17:30:49 +02:00
Stephen Gallagher 03586743f0 contrib/rpm: fix Requires/Provides on subpackages
NetworkManager-wifi and NetworkManager-glib-devel should require
NetworkManager, not provide it.

https://bugzilla.redhat.com/show_bug.cgi?id=1454505
2017-07-20 20:44:06 +02:00
Thomas Haller d61eaf2545 service: don't install dependency for "NetworkManager-wait-online.service" to "network-online.target.wants"
If we install "NetworkManager-wait-online.service" in the
"network-online.target.wants" directory, network-online.target always
pulls in NetworkManager-wait-online.service. As it was, it could only
be disabled by masking the service.

Instead, we should enable NetworkManager-wait-online.sevice via
systemd's preset. That is already done for Fedora 26 and newer.

Note that NetworkManager-wait-online.sevice already has Install.WantedBy.
This way, the dependency is created automatically when enabling the service.

https://bugzilla.redhat.com/show_bug.cgi?id=1455704
2017-07-17 16:04:21 +02:00
Thomas Haller 22ad5422cf contrib/rpm: allow building devel RPMs without debug enabled
Since commit 1afbf948a0,
"build: use different defaults for snapshot builds",
configure would enable debugging options if the version
number is odd.

Hence, on the master branch it was no longer possible to
build an RPM without debugging enabled. Especially,

  ./contrib/fedora/rpm/build_clean.sh -g -W debug

would not work as one would expect.
2017-05-23 22:35:54 +02:00
Thomas Haller 07036d731a contrib/rpm: add option to build package with sanitizer 2017-05-23 22:00:43 +02:00
Thomas Haller 225f7e8602 contrib/rpm: drop explicit dependency on libnl3 package
We already get a library dependency on

    libnl-3.so.200()(64bit)
    libnl-3.so.200(libnl_3)(64bit)

Drop the explicit package dependency, leaving only the
BuildRequires.

Also, all recent versions of libnl3 implement library versioning.
2017-05-18 14:51:06 +02:00
Thomas Haller fb2ef01d85 contrib: update fedora's REQUIRED_PACKAGES list 2017-05-15 12:40:32 +02:00
Thomas Haller fe648f6cde contrib/rpm: fix specifying build with/without libpsl
Fixes: faad17f9e8
2017-05-10 17:07:25 +02:00
Thomas Haller 1975d6fa75 contrib/rpm: reorder variables in spec file 2017-05-10 16:47:24 +02:00
Thomas Haller 7eafd1d833 travis: don't check for setting-docs.c file
Fixes: b3e2808c32
2017-04-05 19:09:25 +02:00
Thomas Haller 29a47f40f8 build: configure explicit paths for dist tarball during "build_clean.sh"
"build_clean.sh" is used to generate a distribution tarball. The tarball
contains pregenerated man pages with default values for paths, which in
turn depend on the configure options when creating the tarball.

Previously, the man page would have paths like "usr/local/etc/NetworkManager/...",
which doesn't seem the best choice for a default man page.

Explicitly set the installation paths.

Also, --disable-dependency-tracking in this mode. It may speed up the
build.
2017-03-24 11:20:00 +01:00
Lubomir Rintel faad17f9e8 contrib/rpm: enable libpsl on Fedora only 2017-03-22 13:01:23 +01:00
Thomas Haller e32839838e udev: drop libgudev in favor of libudev
libgudev is just a wrapper around libudev. We can
use libudev directly and drop the dependency for
libgudev.
2017-03-22 12:41:06 +01:00
Francesco Giudici 7307dea9c4 connectivity: switch connectivity checking to libcurl
[lkundrak@v3.sk: removed libsoup altogether, implemented TODOs and fixed
the poll condition handling]

Co-authored-by: Lubomir Rintel <lkundrak@v3.sk>
2017-03-22 12:09:39 +01:00
Lubomir Rintel c05befd5aa dns-manager: use libpsl directly
...instead of via libsoup. This makes it possible to do gTLD suffix checking
even if we're building without libsoup support.
2017-03-22 12:09:39 +01:00
Thomas Haller e72b43e01f contrib/rpm: reorder spec file and move bcond definitions together 2017-03-06 20:23:15 +01:00
Thomas Haller 560801e237 contrib/rpm: remove unused default_with_* variables
They are unused since commit d2fd1b9fb7.
2017-03-06 20:23:14 +01:00
Thomas Haller 2b6f3ba3cf contrib/rpm: add explicit libxslt build dependency
We configurably use --enable-gtk-doc/--disable-gtk-doc, but
we always require --enable-introspection (due to --enable-vala).

Add the missing build requirement to the "xsltproc" binary, which is in
libxslt package.
2017-03-06 19:59:29 +01:00
Lubomir Rintel d2fd1b9fb7 contrib/rpm: drop EOL versions of Fedora
These are history and noone should be using them; special casing them is
essentially line noise.
2017-03-02 15:51:46 +01:00
Lubomir Rintel ef8c292881 contrib/rpm: install D-Bus service files to /usr if we can
This is in fact the correct location, but dbus in RHEL 7 is still too
old to be able to use that.
2017-03-02 15:51:46 +01:00
Thomas Haller 5caa9d877b contrit/rpm: create source tarball from git immidiately in SOURCES directory
Instead of first creating it as "$TEMP/NetworkManager-${VERSION}.tar.xz"
and then copy it to "$TEMP/SOURCES".
2017-02-16 11:32:53 +01:00
Thomas Haller b04868cb52 contrit/rpm: print the used "$SOURCE" tarball in the summary output of build.sh 2017-02-16 11:04:00 +01:00
Thomas Haller 432717cf47 contrib/rpm: add explict configure options for building NetworkManager in "build_clean.sh"
When we create a source tarball, documentation and other generated files
are disted. Those files depend on the configure options when creating
the tarball. For example, the generated man pages contain the compile time
configurable default values.

For that reason, it is generally better to regenerate the documentation when
building NetworkManager. However, let's set explict configure options to
have a more reproducible way to generate the tarball.

When doing a release, you should not just call `make dist`. Instead, the
proper way of creating an official source tarball is:

  $ ./contrib/fedora/rpm/build_clean.sh --srpm
2017-02-15 23:27:39 +01:00
Thomas Haller 97cdb690f2 contrib/rpm: no longer package the Changelog with the libnm-devel/glib-devel packages 2017-02-14 17:39:46 +01:00
Lubomir Rintel cc1491401f contrib/rpm: don't recreate files that make install installs 2017-01-29 12:28:55 +01:00
Lubomir Rintel a1464f0cfa contrib/rpm: don't own the legacy VPN directory
The plugins should own it instead.
2017-01-29 12:28:55 +01:00
Thomas Haller 0fd3ec81fd contrib/rpm: let NetworkManager-libnm and NetworkManager-glib of differing version conflict
Since commit "c920909 contrib/rpm: put translations in
NetworkManager-libnm and NetworkManager-glib packages", both
subpackages install the same translation files without a direct
dependency between the two packages. Thus, if a user tries
to update only one of the two subpackages, it will fail
during the installation due to conflicting files.

Fix that by having the subpackages conflict (per version).
This way, the conflict is detected before starting the
installation.

https://bugzilla.redhat.com/show_bug.cgi?id=1406454
(cherry picked from commit b85b8ed6fa)
2017-01-20 17:11:55 +01:00
Thomas Haller daf935fb1b contrib/rpm: fix code comment in default "NetworkManager.conf" 2017-01-17 14:26:30 +01:00
Beniamino Galvani c46627e1dc contrib: add macsec test script 2017-01-16 17:47:10 +01:00
Thomas Haller f5100d0681 contrib/rpm: fix obsoletes_ppp_plugin version
The ppp package split was introduced during 1.5.3 development. Thus,
we obsolete packages < 1:1.5.3.

Also, add conditionals around ppp-devel build-requirement.
2016-12-16 09:51:48 +01:00
Lubomir Rintel 8768978751 contrib/rpm: obsolete the pre-ppp-split version from the main package
To ensure smooth upgrade path. While at it, move the BR to a more usual
place.
2016-12-15 20:29:46 +01:00
Thomas Haller 0fce208a8b contrib/rpm: add note to NetworkManager.conf about rate-limiting in logging 2016-12-14 12:51:06 +01:00
Beniamino Galvani bdc61c4e95 contrib/rpm: split PPP support into a separate package
This allows to remove from the main package the PPP dependency.
2016-12-06 11:08:11 +01:00
Lubomir Rintel a96c819f6f contrib/travis: the test outputs are now logged more sanely
Adjust the travis script accordingly.
2016-12-05 13:54:35 +01:00
Lubomir Rintel a0aea99bd7 contrib/rpm: mark the config packages noarch 2016-12-05 13:24:51 +01:00
Thomas Haller a80ba4ea09 build: fix gtk-doc/introspection handling for build
- `make dist` requires --enable-gtk-doc --enable-introspection --with-libnm-glib
- --enable-gtk-doc requires --enable-introspection
- --with-nmcli requires either --enable-introspection or pregenerated
   settings-docs.c files from the dist tarball. It does not require
   --enable-gtk-doc.

There is a bit of a problem in that --enable-introspection requires
now xsltproc. However, gobject-introspection does itself not depend
on xsltproc. So, more correct might be a special --enable-doc argument,
that combines --enable-introspection --with-xsltproc. Anyway, that
seems to make it more complicated then it already is so just implicitly
(and surprisingly?) require xsltproc with --enable-introspection.

https://bugzilla.gnome.org/show_bug.cgi?id=775003
2016-11-28 12:43:51 +01:00
Thomas Haller 7729d85c8c contrib/rpm: let RPM package own %{systemd_dir}/network-online.target.wants
# rpm -qf /usr/lib/systemd/system/network-online.target.wants/NetworkManager-wait-online.service
  NetworkManager-1.5.2-16352.e0c50a9703.fc24.x86_64
  # rpm -qf /usr/lib/systemd/system/network-online.target.wants
  file /usr/lib/systemd/system/network-online.target.wants is not owned by any package
2016-11-24 12:57:27 +01:00
Lubomir Rintel 88f3f29882 build: install the D-Bus introspection data
This would make it easier to develop against NetworkManager D-Bus API.
2016-11-23 15:43:42 +01:00
Lubomir Rintel 612351471c contrib/rpm: drop XML::Parser BR
We don't depend on it already.
2016-11-21 18:34:47 +01:00
Lubomir Rintel d3f7f7abca all: drop YAML dependency 2016-11-21 18:15:42 +01:00
Thomas Haller 8804a5df1d contrib/rpm: no longer manually pre-build parts for make dist
`make dist` should have now the proper dependencies to build everything
that is needed automatically. No need for manually calling make first.
2016-11-20 18:14:37 +01:00
Jiří Klimeš c391fb299b nm-import-openvpn: sort the options alphabetically 2016-11-10 20:56:44 +01:00
Jiří Klimeš 3219bb3b76 nm-import-openvpn: remove old code for 'dev' option 2016-11-10 20:56:44 +01:00
Jiří Klimeš 79643ce28a nm-import-openvpn: parse quoted string as a single word
It is necessary, for example, for this to work:
verify-x509-name "C=US, L=Cambridge, CN=GNOME, emailAddress=networkmanager-list@gnome.org" subject
2016-11-10 20:56:44 +01:00
Jiří Klimeš c4ed2483b2 nm-import-openvpn: import 'verify-x509-name' option
https://git.gnome.org/browse/network-manager-openvpn/commit/?id=b51b3562ce079cc0be426e968fe1c90faadc0efd
2016-11-10 20:56:44 +01:00
Jiří Klimeš bc446c3ab8 nm-import-openvpn: improve importing 'comp-lzo' option
https://bugzilla.gnome.org/show_bug.cgi?id=769177
https://bugzilla.redhat.com/show_bug.cgi?id=1355688
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833166
https://git.gnome.org/browse/network-manager-openvpn/commit/?id=62bdd278d69cc396479af9d05a0b776d5ad386bf
2016-11-10 20:56:44 +01:00
Jiří Klimeš e58cfa4fc1 nm-import-openvpn: improve parsing and checking 'route' option 2016-11-10 20:56:44 +01:00
Jiří Klimeš f7e4b748e1 nm-import-openvpn: import 'ns-cert-type' option
https://bugzilla.gnome.org/show_bug.cgi?id=719430
https://git.gnome.org/browse/network-manager-openvpn/commit/?id=644e55ed404edbc953e323d13c57297b53cc0f8b
2016-11-10 20:56:44 +01:00
Jiří Klimeš 978328712b nm-import-openvpn: import 'tls-cipher' option
https://bugzilla.gnome.org/show_bug.cgi?id=763484
https://git.gnome.org/browse/network-manager-openvpn/commit/?id=d7a84afe1d1948c7990a08b18913e65550c222a0
2016-11-10 20:56:44 +01:00
Jiří Klimeš 367d13a7dd nm-import-openvpn: import 'max-routes' option
https://bugzilla.gnome.org/show_bug.cgi?id=720097
https://git.gnome.org/browse/network-manager-openvpn/commit/?id=c4d45e51280d5b0cb8c5e8f826d68c3262162080
2016-11-10 20:56:44 +01:00
Jiří Klimeš 966e0fb50e nm-import-openvpn: import 'tun-ipv6' option
https://bugzilla.gnome.org/show_bug.cgi?id=761907
https://git.gnome.org/browse/network-manager-openvpn/commit/?id=ffda527d8a932f2e3419d6c64623540e5b190d9e
2016-11-10 20:56:44 +01:00
Thomas Haller 5f00a20f38 contrib/rpm: fix wrong configure options in spec file 2016-11-10 18:30:38 +01:00
Thomas Haller c9209093b4 contrib/rpm: put translations in NetworkManager-libnm and NetworkManager-glib packages
One can install the libraries without NetworkManager. Thus, the
translations should be there.

Doing this increases the package size of the libraries significantly.

For a user who only has libnm without NetworkManager installed, this
is acceptable, because the whole point of the change is to ensure such
a user also gets translations.

For a user who requires libnm and libnm-glib packages, this
unfortunately increases the additional package size as the translations
are now present twice.

What would be better is if NetworkManager-libnm would only contain
translations for libnm/NetworkManager, and NetworkManager-glib only
translations for libnm-util/libnm-glib.
2016-11-08 10:21:44 +01:00
Lubomir Rintel 9d31cc916f Revert "contrib/rpm: regenerate the linker version script NetworkManager.ver while building the package"
Back this out. It breaks i686 build unnecessarily now and also is
something that proabably that should run on distcheck and not package
build.

This reverts commit cf678811b5.
2016-11-06 15:19:16 +01:00
Lubomir Rintel 9bd0ea7954 contrib/rpm: drop dhclient requirement
We fall back to the internal client for the very minimal installations.
Based on: 209b5a57fd
2016-11-03 17:56:38 +01:00
Lubomir Rintel b8785c8c3c Revert "contrib/rpm: add NetworkManager-config-dhcp-dhclient package"
This probably needs more discussion, maybe there's a better solution
than a separate RPM package for a single line of configuration.

Related: https://pagure.io/fedora-comps/pull-request/62

This reverts commit 209b5a57fd.
2016-11-03 17:56:13 +01:00
Lubomir Rintel dcc13cfcd8 contrib/rpm: drop udev dependency
We happily run in containers without udev.
2016-11-03 16:01:23 +01:00
Lubomir Rintel ef0a68b942 contrib/rpm: drop iptables and dnsmasq dependencies
We just fail ipv4.method=shared without it, no need to drag it in for
configurations that don't share IPv4.
2016-11-03 16:01:23 +01:00
Lubomir Rintel 64770ee518 contrib/rpm: drop explicit readline dependency
RPM auto-generates a SONAME dependency.
2016-11-03 16:01:23 +01:00
Lubomir Rintel 5f4be85742 contrib/rpm: drop iproute dependency
We don't actually ever need it.
2016-11-03 16:01:23 +01:00
Thomas Haller 0fa2cf19e5 vapi: add vapi NM-1.0 for libnm
Initial vala API for libnm. Consider it unstable, it probably needs
improvements.

https://bugzilla.gnome.org/show_bug.cgi?id=773588
2016-11-03 10:15:42 +01:00
Thomas Haller 1c1da147c9 contrib/rpm: update comments in NetworkManager.conf explaining /var/lib/NetworkManager/conf.d 2016-10-27 11:50:24 +02:00
Thomas Haller 209b5a57fd contrib/rpm: add NetworkManager-config-dhcp-dhclient package
This allows to get rid of the dhclient requirement of NetworkManager
package and moves the package dependency to the new sub package
NetworkManager-config-dhcp-dhclient.

For the moment, I think dhclient should still be the default choice for
regular users due to dhclient providing better better previledge separation
of network facing code. A user who knows that he's doing, can now however
remove dhclient while keeping NetworkManager.

https://bugzilla.redhat.com/show_bug.cgi?id=1204226
2016-10-27 11:46:15 +02:00
Thomas Haller 2238ccb48b travis: run tests in parallel 2016-10-21 17:37:56 +02:00
Thomas Haller 491aad08a9 contrib/rpm: run make check in parallel (again)
Revert commit f551c91d33 and restore
parallel `make check`. It should work.
2016-10-19 15:26:30 +02:00
Thomas Haller f551c91d33 Revert "contrib/rpm: run make check in parallel"
`make check -C libnm/tests` is not yet ready to run in
parallel. Revert.

This reverts commit 0a1508358d.
2016-10-14 15:48:27 +02:00
Thomas Haller 5ea3196376 contrib/rpm: rename obsoletes_nmver to obsoletes_version_device_plugins
We will have multiple obsoletes
2016-10-14 11:26:13 +02:00
Thomas Haller c4325f6494 contrib/rpm: force compilation with "--enable-ld-gc"
It should already be autodetected. Just be explicit about it.
2016-10-14 10:33:30 +02:00
Thomas Haller 0a1508358d contrib/rpm: run make check in parallel 2016-10-14 10:33:30 +02:00
Thomas Haller cf678811b5 contrib/rpm: regenerate the linker version script NetworkManager.ver while building the package 2016-10-14 10:33:30 +02:00
Thomas Haller 54f701b95c contrib/rpm: fix build_clean.sh --quick after removing shared/Makefile.am
Fixes: 24f566afa0
2016-10-14 10:02:46 +02:00
Lubomir Rintel 790e23df67 build: fix required packages list 2016-10-10 18:51:23 +02:00
Lubomir Rintel e59ed6451f contrib/rpm: require at least the version of glib we built against
glib neither versions its symbols nor bumps SONAME on API changes, so rpm can't
figure out the correct dependencies itself.

https://bugzilla.redhat.com/show_bug.cgi?id=1378809
2016-09-23 12:20:23 +02:00
Thomas Haller 4cce0b7cf4 contrib/rpm: fix wrong argument to configure script
Fixes: aff491b6f3
(cherry picked from commit 5d09d45b42)
2016-08-18 14:54:04 +02:00
Thomas Haller 959e151722 contrib/rpm: update spec file to make it more similar to RHEL's version
(cherry picked from commit aff491b6f3)
2016-08-18 12:40:08 +02:00
Thomas Haller cfd3e1a13c contrib/rpm: improve detection of ppp_version from spec file
https://bugzilla.redhat.com/show_bug.cgi?id=1334913
2016-07-07 12:33:09 +02:00
Thomas Haller c87e1ef525 contrib/rpm: fix %{snap} define to have snapshot before git-sha
In case, where both
  %global snapshot git20160606
  %global git_sha b769b4df
is set, they version number should be
  .git20160606.b769b4df
not
  .b769b4df.git20160606
2016-07-07 12:33:09 +02:00
Thomas Haller 24430e4b07 contrib/rpm: don't enable sanitizer for debug build
There are valid failures, for which sanitizer would kill
NetworkManager:

  audit[1380]: AVC avc:  denied  { setrlimit } for  pid=1380 comm="NetworkManager" scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:system_r:NetworkManager_t:s0 tclass=process permissive=0
  NetworkManager[1380]: ==1380==ERROR: AddressSanitizer setrlimit() failed 13

Disable sanitizer to make debug builds working again, at least for now.
2016-06-07 09:15:26 +02:00
Beniamino Galvani 01540cf1d3 build: add options to compile with address/undefined sanitizers
This adds two new options to the configure scripts to compile NM,
clients and libraries with the address and undefined-behavior
sanitizers available in recent GCC versions. Clang is not supported at
moment.
2016-06-03 22:19:38 +02:00
Thomas Haller 5dea2efd9e contrib/rpm: add Requires to exact wwan version for NetworkManager-bluetooth subpackage
rpmdiff complains:

  Subpackage NetworkManager-bluetooth on aarch64 x86_64 ppc64 ppc64le s390x
  consumes library libnm-wwan.so()(64bit) from subpackage NetworkManager-wwan
  but does not have explicit package version requirement.
  Please add Requires: NetworkManager-wwan = %{version}-%{release} to
  NetworkManager-bluetooth in the specfile to avoid the need to test
  interoperability between the various combinations of old and new subpackages.

And indeed, device plugins don't have a stable API/ABI, and requires
exact NetworkManager and wwan versions. This was already enforced implicitly,
because all device plugins require the same exact NetworkManager version.
2016-06-02 09:44:37 +02:00
Thomas Haller aae89ab8bb contrib: update REQUIRED_PACKAGES list
Needed to build contrib/rpm.
2016-05-31 16:54:47 +02:00
Thomas Haller 13ab20fe8c contrib/rpm: refactor specifying package version in spec file
Similar to what we do for RHEL and Fedora's spec file.
2016-05-06 15:54:19 +02:00
Thomas Haller a38aa2fdb2 contrib/rpm: make package "NetworkManager-dispatcher-routing-rules" as "BuildArch: noarch" 2016-05-05 19:43:32 +02:00
Thomas Haller a447942fc0 contrib/rpm: rename package "NetworkManager-config-routing-rules" to "NetworkManager-dispatcher-routing-rules" 2016-05-05 19:25:53 +02:00
Thomas Haller 781e9603ca contrib/rpm: split "10-ifcfg-rh-routes.sh" script to NetworkManager-config-routing-rules package
Like we do on RHEL. The package-split was originally necessary because
installing a pre-up dispatcher script would block activation (even if there
were no relevant route files.

Even if we have now the no-wait.d/ directory for dispatchers, still
split the package. It makes sense to have the routing-rules in a
separate RPM.

For contrib/rpm, we don't properly obsolete an older version of
NetworkManager package and thus the upgrade path will be broken.
2016-05-05 19:18:45 +02:00
Beniamino Galvani 7e5b0c94e6 contrib/fedora: add dependency on jansson 2016-04-18 21:50:36 +02:00
Lubomir Rintel 0fc0cc68fc man: move nmcli-examples to section 7
It really is not a configuration file and doesn't belong to section 5.
2016-04-05 14:37:51 +02:00
Thomas Haller 4be28b3916 contrib/rpm: fix logic in build.sh about specifying source
When the user neither specifies SOURCE or SOURCE_FROM_GIT,
we first want to detect a tarball in the current directory,
and as second fallback to SOURCE_FROM_GIT=1.

If either SOURCE or SOURCE_FROM_GIT is set, we want to do
that and not detect anything.

The logic was wrong.
2016-04-01 15:54:06 +02:00
Thomas Haller 6fb80e1060 contrib/rpm: improve build_clean.sh to explicitly set $SOURCE_FROM_GIT
Presiouvly, when there was a tarball file in the top git-tree, it would
have been choosen and no easy way to overwrite the decision to build
from a git-archive. Now you can safely build current HEAD by simply calling

  ./contrib/fedora/rpm/build_clean.sh -g

Contrary to the regular build which calls `make dist`, this doesn't
require a clean working copy and no need to purge it with git-clean.
2016-04-01 09:25:11 +02:00
Thomas Haller 3b6fc5cbda contrib/rpm: add comments to build.sh to list script arguments 2016-03-30 15:00:02 +02:00
Thomas Haller a348bda6ea contrib/rpm: fix obtaining SOURCE via git-archive
- when user provided a $SOURCE argument, do call abs_path on
  it. abs_path allows the user to provide relative paths in
  the original directory.

- don't call abs_path on "$GITDIR/NetworkManager-$VERSION".tar.xz
  abs_path is there to verify user input and it will abort the script
  if the file doesn't exist.

- when creating a temporary tarball via git-archive, put it
  into the output directory and not overwriting files in
  $GITDIR.

- fix abs_path to return an error code and let callers abort
  the script

- add a new parameter $SOURCE_FROM_GIT so that you can control
  whether git-archive is used. You can now specify either $SOURCE
  or $SOURCE_FROM_GIT. In case of absence of both, it tries to
  detect a tar file in the $GITDIR directory.

Fixes: 9e9ec1a3da
2016-03-30 14:50:55 +02:00
Lubomir Rintel 9e9ec1a3da contrib/rpm: allow building of a git archive
No need for a make dist.
2016-03-30 13:25:49 +02:00
Lubomir Rintel e3e0a49075 contrib/rpm: allow building w/o prebuilt documentation 2016-03-30 13:25:49 +02:00
Lubomir Rintel 6da97a8c48 contrib/rpm: with-udev-dir now has a sensible default 2016-03-14 16:32:15 +01:00
Lubomir Rintel df9ac197c0 contrib/rpm: macro cosmetics 2016-03-05 18:56:28 +01:00
Lubomir Rintel c0d7810271 contrib/rpm: include the valgrind suppression file in debuginfo package 2016-03-05 18:56:28 +01:00
Thomas Haller 6adf25c53c contrib/rpm: print dnf-install command at the end of build.sh 2016-02-26 14:36:49 +01:00
Thomas Haller 0685780566 contrib/rpm: add README, improve usage output and rename --no-build option to --no-dist 2016-02-17 11:44:09 +01:00
Thomas Haller 7ec5acdc66 travis: fix setting NMTST_DEBUG for travis-check.sh script 2016-02-12 16:54:40 +01:00
Thomas Haller ac97715688 contrib/rpm: create dnsmasq-shared.d configuration directory 2016-02-12 13:01:53 +01:00
Thomas Haller e58b3dac80 contrib/rpm: wrap long description lines
rpmlint warns description-line-too-long if the line exceeds 79 characters.
2016-02-04 18:04:43 +01:00
Thomas Haller 0661f66c40 contrib/rpm: minor cleanup 2016-02-04 17:59:05 +01:00
Thomas Haller 05b34e11d6 contrib/rpm: update comment in 00-server.conf 2016-02-03 16:25:19 +01:00
Thomas Haller b4d1e3eb7b contrib/rpm: remove unneeded chkconfig and systemd-sysv requirements 2016-02-03 16:19:02 +01:00
Thomas Haller 5344a3297b contrib/rpm: remove unused 10-ibft-plugin.conf file
Fixes: 6f0036151f
2016-02-03 15:57:58 +01:00
Thomas Haller 6490dc154c contrib/rpm: add rpm_version in spec file
and rename realversion to real_version to follow the pattern.
2016-02-03 15:47:28 +01:00
Thomas Haller 455b981215 contrib/rpm: update comment for patches in spec file
We don't want to create backups of original files when
patching. Update the comment in the spec file to indicate
that.
2016-02-03 15:42:19 +01:00
Thomas Haller 87dc14476b contrib/rpm: make build more configurable by using conditionals
Also add a new conditional "debug" to enable more assertions and
more logging, which is disabled by default.

Also add a conditional "test" to disable running the unit tests
(make check) while building the package.

http://rpm.org/wiki/PackagerDocs/ConditionalBuilds
2016-02-02 16:09:24 +01:00
Thomas Haller 3b01d25561 contrib/rpm: add --no-build option to build_clean.sh
Option to skip building the source package. Useful if you already
have a source tarball from a previous run.
2016-02-02 16:05:23 +01:00
Thomas Haller bb78d14467 contrib/rpm: add comment to NetworkManager.conf about debug logfiles 2016-01-27 14:11:24 +01:00
Lubomir Rintel 1408b8c0a2 travis: add coverity submission
Also, decouple the build from the test run; it looks better in the .yml file as
well as in the travis UI.
2016-01-22 22:12:43 +01:00