diff --git a/ptpd.changes b/ptpd.changes
index e57a718..133d0cc 100644
--- a/ptpd.changes
+++ b/ptpd.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Thu Mar  8 13:30:11 UTC 2018 - mpluskal@suse.com
+
+- Generate default config during build
+
 -------------------------------------------------------------------
 Thu Jan 25 08:08:17 UTC 2018 - mpluskal@suse.com
 
diff --git a/ptpd.spec b/ptpd.spec
index 6054f1f..b6d40e9 100644
--- a/ptpd.spec
+++ b/ptpd.spec
@@ -29,7 +29,6 @@ Group:          System/Daemons
 URL:            https://github.com/ptpd/ptpd
 Source0:        https://github.com/ptpd/ptpd/archive/ptpd-%{version}.tar.gz
 Source1:        ptpd2.service
-Source2:        ptpd2.conf
 Source3:        conf.sysconfig.ptpd
 # PATCH-FIX-UPSTREAM ptpd2-net-snmp_U64.patch gh#ptpd/ptpd#25
 Patch0:         ptpd2-net-snmp_U64.patch
@@ -73,10 +72,14 @@ autoreconf -fiv
 
 %install
 %make_install
-install -D -p -m 0644 %{SOURCE1} %{buildroot}/%{_unitdir}/%{name}2.service
+install -Dpm 0644 %{SOURCE1} \
+  %{buildroot}/%{_unitdir}/%{name}2.service
 ln -sv %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}2
-install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}2.conf
-install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_fillupdir}/sysconfig.ptpd2
+# Generate default config
+install -d %{buildroot}%{_sysconfdir}
+./src/ptpd2 --default-config > %{buildroot}%{_sysconfdir}/%{name}2.conf
+install -Dpm 0644 %{SOURCE3} \
+  %{buildroot}%{_fillupdir}/sysconfig.ptpd2
 # have to create the below, else ptpd will not log drift
 install -d %{buildroot}%{_localstatedir}/log
 touch %{buildroot}%{_localstatedir}/log/ptpd2_kernelclock.drift
@@ -95,8 +98,9 @@ touch %{buildroot}%{_localstatedir}/log/ptpd2_kernelclock.drift
 %service_del_postun %{name}2.service
 
 %files
-%doc COPYRIGHT ChangeLog README
-%config %{_sysconfdir}/%{name}2.conf
+%license COPYRIGHT
+%doc ChangeLog README
+%config(noreplace) %{_sysconfdir}/%{name}2.conf
 %{_sbindir}/ptpd2
 %{_sbindir}/rcptpd2
 %{_mandir}/man5/ptpd2.conf.5%{ext_man}