Fix rpm spec warnings 97/98497/1
authorKyungwook Tak <k.tak@samsung.com>
Tue, 15 Nov 2016 07:34:04 +0000 (16:34 +0900)
committerKyungwook Tak <k.tak@samsung.com>
Tue, 15 Nov 2016 08:47:51 +0000 (17:47 +0900)
Change-Id: I469c3dd67e66fa53fb1bb05ca1e5f2c3d019930f
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
14 files changed:
packaging/csr-framework.spec
test/CMakeLists.txt
test/pkgs/target/MaliciousWgt.wgt [changed from file to symlink]
test/pkgs/target/non-malware.wgt [changed from file to symlink]
test/resources/test_dir/a.txt
test/resources/test_dir/b.txt
test/resources/test_dir/c.txt
test/resources/test_dir/dir1/dir1a.txt
test/resources/test_dir/dir1/dir1b.txt
test/resources/test_dir/dir1/unremovable_file
test/resources/test_dir/dir2/dir2a.txt
test/resources/test_dir/dir3/dir4/dir4a.txt
test/resources/test_dir/testwritefile.txt
test/resources/test_malware_file

index 5517d79..3b41e97 100644 (file)
@@ -84,7 +84,7 @@ file contents and checking url to prevent malicious items.
 %endif
 
 %package -n lib%{name}-common
-Summary: Common library package for %{name}
+Summary: CSR framework (common library)
 License: Apache-2.0
 Group:   Security/Libraries
 %if "%{?tizen_version}" == "3.0"
@@ -95,10 +95,10 @@ BuildRequires: pkgconfig(libsmack)
 Requires: %{sbin_dir}/ldconfig
 
 %description -n lib%{name}-common
-csr-framework common library package.
+Content Screening and Reputation framework package (common library)
 
 %package -n lib%{name}-client
-Summary: Client library package for %{name}
+Summary: CSR framework (client library)
 License: Apache-2.0
 Group:   Security/Libraries
 BuildRequires: pkgconfig(capi-base-common)
@@ -106,10 +106,10 @@ Requires: %{name} = %{version}-%{release}
 Requires: %{sbin_dir}/ldconfig
 
 %description -n lib%{name}-client
-csr-framework client library package.
+Content Screening and Reputation framework package (client library)
 
 %package devel
-Summary: Development files for %{name}
+Summary: CSR framework (development files)
 LICENSE: Apache-2.0
 Group:   Security/Development
 BuildRequires: pkgconfig(capi-base-common)
@@ -117,18 +117,19 @@ Requires:      %{name} = %{version}-%{release}
 Requires:      lib%{name}-client
 
 %description devel
-csr-framework development files including headers and pkgconfig file.
+Content Screening and Reputation framework development files like headers and pkgconfigs
 
 %package engine-devel
-Summary: Development files for %{name} engine
+Summary: CSR framework (engine development files)
 LICENSE: Apache-2.0
 Group:   Security/Development
 
 %description engine-devel
-csr-framework engine development files including headers and pkgconfig file.
+Content Screening and Reputation framework engine development files like headers and
+pkgconfigs
 
 %package test
-Summary: test program for %{name}
+Summary: CSR framework (test program)
 License: Apache-2.0 and BSL-1.0
 Group:   Security/Testing
 BuildRequires: boost-devel
@@ -137,7 +138,7 @@ BuildRequires: pkgconfig(glib-2.0)
 Requires:      %{name} = %{version}
 
 %description test
-test program of csr-framework
+Content Screening and Reputation framework (test program)
 
 %prep
 %setup -q
@@ -194,21 +195,10 @@ make %{?jobs:-j%jobs}
 
 %install
 %make_install
-mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
-mkdir -p %{buildroot}%{popup_unitdir}/sockets.target.wants
-ln -s ../%{service_name}-cs.socket %{buildroot}%{_unitdir}/sockets.target.wants/%{service_name}-cs.socket
-ln -s ../%{service_name}-wp.socket %{buildroot}%{_unitdir}/sockets.target.wants/%{service_name}-wp.socket
-ln -s ../%{service_name}-admin.socket %{buildroot}%{_unitdir}/sockets.target.wants/%{service_name}-admin.socket
-ln -s ../%{service_name}-popup.socket %{buildroot}%{popup_unitdir}/sockets.target.wants/%{service_name}-popup.socket
-
-mkdir -p %{buildroot}%{ro_data_dir}/license
-cp LICENSE %{buildroot}%{ro_data_dir}/license/%{name}
-cp LICENSE.BSL-1.0 %{buildroot}%{ro_data_dir}/license/%{name}.BSL-1.0
-cp LICENSE %{buildroot}%{ro_data_dir}/license/lib%{name}-client
-cp LICENSE %{buildroot}%{ro_data_dir}/license/lib%{name}-common
-
-cp LICENSE %{buildroot}%{ro_data_dir}/license/%{name}-test
-cp LICENSE.BSL-1.0 %{buildroot}%{ro_data_dir}/license/%{name}-test.BSL-1.0
+%install_service sockets.target.wants %{service_name}-cs.socket
+%install_service sockets.target.wants %{service_name}-wp.socket
+%install_service sockets.target.wants %{service_name}-admin.socket
+%install_service ../user/sockets.target.wants %{service_name}-popup.socket
 
 mkdir -p %{buildroot}%{rw_db_dir}
 mkdir -p %{buildroot}%{ro_db_dir}
@@ -230,33 +220,29 @@ if [ $1 = 1 ]; then
     systemctl start %{service_name}-cs.socket
     systemctl start %{service_name}-wp.socket
     systemctl start %{service_name}-admin.socket
-    systemctl start %{service_name}-popup.socket
-
     systemctl start %{service_name}.service
-    systemctl start %{service_name}-popup.service
-fi
 
-if [ $1 = 2 ]; then
+    systemctl --user start %{service_name}-popup.socket
+    systemctl --user start %{service_name}-popup.service
+elif [ $1 = 2 ]; then
     systemctl stop %{service_name}-cs.socket
     systemctl stop %{service_name}-wp.socket
     systemctl stop %{service_name}-admin.socket
-    systemctl stop %{service_name}-popup.socket
-
-    systemctl stop %{service_name}-popup.service
-    systemctl stop %{service_name}.service
-
     systemctl restart %{service_name}.service
-    systemctl restart %{service_name}-popup.service
+
+    systemctl --user stop %{service_name}-popup.socket
+    systemctl --user restart %{service_name}-popup.service
 fi
 
 %preun
 if [ $1 = 0 ]; then
-    systemctl stop %{service_name}-popup.service
-    systemctl stop %{service_name}.service
     systemctl stop %{service_name}-cs.socket
     systemctl stop %{service_name}-wp.socket
     systemctl stop %{service_name}-admin.socket
-    systemctl stop %{service_name}-popup.socket
+    systemctl stop %{service_name}.service
+
+    systemctl --user stop %{service_name}-popup.socket
+    systemctl --user stop %{service_name}-popup.service
 fi
 
 %postun
@@ -275,8 +261,8 @@ chsmack -a "_" %{test_dir}/test_dir/dir1
 %files
 %defattr(-,root,root,-)
 %manifest %{service_name}.manifest
-%{ro_data_dir}/license/%{name}
-%{ro_data_dir}/license/%{name}.BSL-1.0
+%license LICENSE
+%license LICENSE.BSL-1.0
 %{bin_dir}/%{service_name}-server
 %{bin_dir}/%{service_name}-popup
 %{_unitdir}/%{service_name}.service
@@ -309,13 +295,13 @@ chsmack -a "_" %{test_dir}/test_dir/dir1
 %files -n lib%{name}-common
 %defattr(-,root,root,-)
 %manifest %{service_name}-common.manifest
-%{ro_data_dir}/license/lib%{name}-common
+%license LICENSE
 %{_libdir}/lib%{service_name}-common.so.*
 
 %files -n lib%{name}-client
 %defattr(-,root,root,-)
 %manifest %{service_name}-client.manifest
-%{ro_data_dir}/license/lib%{name}-client
+%license LICENSE
 %{_libdir}/lib%{service_name}-client.so.*
 
 %files devel
@@ -344,8 +330,8 @@ chsmack -a "_" %{test_dir}/test_dir/dir1
 %files test
 %defattr(-,root,root,-)
 %manifest %{service_name}-test.manifest
-%{ro_data_dir}/license/%{name}-test
-%{ro_data_dir}/license/%{name}-test.BSL-1.0
+%license LICENSE
+%license LICENSE.BSL-1.0
 %{_libdir}/lib%{service_name}-test-common.so
 %attr(-, %{test_user}, %{service_group}) %{bin_dir}/%{service_name}-test
 %attr(-, %{test_user}, %{service_group}) %{bin_dir}/%{service_name}-internal-test
@@ -353,11 +339,11 @@ chsmack -a "_" %{test_dir}/test_dir/dir1
 %attr(-, %{test_user}, %{service_group}) %{bin_dir}/%{service_name}-threadpool-test
 
 # test resources
-%dir %attr(777, %{test_user}, %{service_group}) %{test_dir}
-%attr(777, %{test_user}, %{service_group}) %{test_dir}/*
+%dir %attr(-, %{test_user}, %{service_group}) %{test_dir}
+%attr(-, %{test_user}, %{service_group}) %{test_dir}/*
 
-%dir %attr(777, %{test_user}, %{service_group}) %{test_res_dir}
-%attr(777, %{test_user}, %{service_group}) %{test_res_dir}/*
+%dir %attr(-, %{test_user}, %{service_group}) %{test_res_dir}
+%attr(-, %{test_user}, %{service_group}) %{test_res_dir}/*
 
 # sample engine related files
 %if 0%{?with_sample_engine}
index f6ef7ad..7a7b787 100755 (executable)
@@ -102,7 +102,21 @@ TARGET_LINK_LIBRARIES(${TARGET_CSR_TEST}
 )
 
 INSTALL(TARGETS ${TARGET_CSR_TEST} DESTINATION ${BIN_DIR})
-INSTALL(DIRECTORY resources/ DESTINATION ${TEST_DIR})
+INSTALL(
+       DIRECTORY resources/ DESTINATION ${TEST_DIR}
+       FILE_PERMISSIONS
+               OWNER_READ
+               OWNER_WRITE
+               GROUP_READ
+               GROUP_WRITE
+       DIRECTORY_PERMISSIONS
+               OWNER_READ
+               OWNER_WRITE
+               OWNER_EXECUTE
+               GROUP_READ
+               GROUP_WRITE
+               GROUP_EXECUTE
+)
 INSTALL(DIRECTORY pkgs/ DESTINATION ${TEST_RES_DIR})
 
 ADD_SUBDIRECTORY(internals)
deleted file mode 100644 (file)
index 97510d6f54a8127db47c7f144813417d243d0920..0000000000000000000000000000000000000000
Binary files a/test/pkgs/target/MaliciousWgt.wgt and /dev/null differ
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..3e6bef11cb49587cfb5a2593e3b7cafa9783641f
--- /dev/null
@@ -0,0 +1 @@
+../emulator/MaliciousWgt.wgt
\ No newline at end of file
deleted file mode 100644 (file)
index b78ae5a932a4164064ddefd850de6b3a8e996f0d..0000000000000000000000000000000000000000
Binary files a/test/pkgs/target/non-malware.wgt and /dev/null differ
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..8569e65c480d26ee167379718fcf794f38a98a6d
--- /dev/null
@@ -0,0 +1 @@
+../emulator/non-malware.wgt
\ No newline at end of file
index 704cac8..96d18e4 100644 (file)
@@ -1 +1,2 @@
 X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
+unremovable file!
index 704cac8..9790ecc 100644 (file)
@@ -1 +1,2 @@
 X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
+test_malware_file