From: joonbum.ko Date: Wed, 5 Jul 2017 08:04:51 +0000 (+0900) Subject: Clean up the spec file and change the versioning policy of shared object. X-Git-Tag: accepted/tizen/unified/20170711.180707~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1fec2a12d598096dc91af835717a64a2ae39ec1b;p=platform%2Fcore%2Fuifw%2Flibtpl-egl.git Clean up the spec file and change the versioning policy of shared object. - If user install these packages after this commit, symbolic links are created as shown below. [Packages for Installation] - Exclude .so file install dir = /usr/lib/ libtpl-egl.so.{TPL_VERSION_MAJOR} -> libtpl-egl.so.{TPL_VERSION} libtpl-egl.so.{TPL_VERSION} libwayland-egl.so.{WL_EGL_VERSION_MAJOR} -> libwayland-egl.so.{WL_EGL_VERSION} libwayland-egl.so.{WL_EGL_VERSION} [Devel Packages] - Include .so files libtpl-egl.so -> libtpl-egl.so.{TPL_VERSION} libwayland-egl.so -> libwayland-egl.so.{WL_EGL_VERSION} Change-Id: I9200e542a91d21caf7f97a0b0289e78bb6da07d5 Signed-off-by: joonbum.ko --- diff --git a/Makefile b/Makefile index 97996bc..7d61988 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,8 @@ $(findstring -$1-,-$(TPL_OPTIONS)-) endef SRC_DIR = ./src -SO_NAME = libtpl-egl.so.$(TPL_VERSION_MAJOR).$(TPL_VERSION_MINOR) -BIN_NAME = $(SO_NAME).$(TPL_VERSION_PATCH) +SO_NAME = libtpl-egl.so.$(TPL_VERSION_MAJOR) +BIN_NAME = $(SO_NAME).$(TPL_VERSION_MINOR).$(TPL_VERSION_PATCH) INST_DIR = $(libdir) CC ?= gcc diff --git a/packaging/libtpl-egl.spec b/packaging/libtpl-egl.spec index df11a41..e28f93a 100644 --- a/packaging/libtpl-egl.spec +++ b/packaging/libtpl-egl.spec @@ -122,7 +122,7 @@ Wayland EGL backend Version: %{WL_EGL_VERSION} Release: 0 Summary: Development header files for use with Wayland protocol -Requires: libwayland-egl +Requires: libwayland-egl %description -n libwayland-egl-devel Development header files for use with Wayland protocol @@ -192,7 +192,9 @@ make all #libwayland-egl build %if "%{TPL_WINSYS}" == "WL" cd src/wayland-egl -export WL_EGL_SO_VER=%{WL_EGL_VERSION} +export WL_EGL_VERSION_MAJOR=%{WL_EGL_VERSION_MAJOR} +export WL_EGL_VERSION_MINOR=%{WL_EGL_VERSION_MINOR} +export WL_EGL_VERSION_PATCH=%{WL_EGL_VERSION_PATCH} make cd ../../ %endif @@ -228,19 +230,17 @@ export TPL_VERSION_PATCH=%{TPL_VERSION_PATCH} make install libdir=%{buildroot}%{_libdir} -ln -sf libtpl-egl.so.%{TPL_VERSION} %{buildroot}%{_libdir}/libtpl-egl.so.%{TPL_VERSION_MAJOR}.%{TPL_VERSION_MINOR} -ln -sf libtpl-egl.so.%{TPL_VERSION_MAJOR}.%{TPL_VERSION_MINOR} %{buildroot}%{_libdir}/libtpl-egl.so.%{TPL_VERSION_MAJOR} -ln -sf libtpl-egl.so.%{TPL_VERSION_MAJOR} %{buildroot}%{_libdir}/libtpl-egl.so +ln -sf libtpl-egl.so.%{TPL_VERSION} %{buildroot}%{_libdir}/libtpl-egl.so cp -a src/tpl.h %{buildroot}%{_includedir}/ cp -a pkgconfig/tpl-egl.pc %{buildroot}%{_libdir}/pkgconfig/ %if "%{TPL_WINSYS}" == "WL" cd src/wayland-egl -cp libwayland-egl.so.%{WL_EGL_VERSION} %{buildroot}%{_libdir}/libwayland-egl.so -cp libwayland-egl.so.%{WL_EGL_VERSION} %{buildroot}%{_libdir}/libwayland-egl.so.%{WL_EGL_VERSION_MAJOR} -cp libwayland-egl.so.%{WL_EGL_VERSION} %{buildroot}%{_libdir}/libwayland-egl.so.%{WL_EGL_VERSION_MAJOR}.%{WL_EGL_VERSION_MINOR} -export WL_EGL_SO_VER=%{WL_EGL_VERSION} +ln -sf libwayland-egl.so.%{WL_EGL_VERSION} %{buildroot}%{_libdir}/libwayland-egl.so +export WL_EGL_VERSION_MAJOR=%{WL_EGL_VERSION_MAJOR} +export WL_EGL_VERSION_MINOR=%{WL_EGL_VERSION_MINOR} +export WL_EGL_VERSION_PATCH=%{WL_EGL_VERSION_PATCH} %makeinstall cd - @@ -276,9 +276,6 @@ cp -a %{_builddir}/%{buildsubdir}/tc/libs/gtest/googletest/LICENSE %{buildroot}/ %manifest packaging/libtpl-egl.manifest %license COPYING %defattr(-,root,root,-) -%{_libdir}/libtpl-egl.so -%{_libdir}/libtpl-egl.so.%{TPL_VERSION_MAJOR} -%{_libdir}/libtpl-egl.so.%{TPL_VERSION_MAJOR}.%{TPL_VERSION_MINOR} %{_libdir}/libtpl-egl.so.%{TPL_VERSION} %if "%{ENABLE_WORKER_TEST_ONLY}" == "1" @@ -298,18 +295,17 @@ cp -a %{_builddir}/%{buildsubdir}/tc/libs/gtest/googletest/LICENSE %{buildroot}/ %defattr(-,root,root,-) %{_includedir}/tpl.h %{_libdir}/pkgconfig/tpl-egl.pc +%{_libdir}/libtpl-egl.so %if "%{TPL_WINSYS}" == "WL" %files -n libwayland-egl %manifest packaging/libwayland-egl.manifest %license COPYING %defattr(-,root,root,-) -%{_libdir}/libwayland-egl.so -%{_libdir}/libwayland-egl.so.%{WL_EGL_VERSION_MAJOR} -%{_libdir}/libwayland-egl.so.%{WL_EGL_VERSION_MAJOR}.%{WL_EGL_VERSION_MINOR} %{_libdir}/libwayland-egl.so.%{WL_EGL_VERSION} %files -n libwayland-egl-devel %defattr(-,root,root,-) +%{_libdir}/libwayland-egl.so %{_libdir}/pkgconfig/wayland-egl.pc %endif diff --git a/src/wayland-egl/Makefile b/src/wayland-egl/Makefile index a1c3654..7bd54a4 100644 --- a/src/wayland-egl/Makefile +++ b/src/wayland-egl/Makefile @@ -1,4 +1,5 @@ -WL_EGL_SO_VER ?= no_ver +WL_EGL_SO_NAME = libwayland-egl.so.$(WL_EGL_VERSION_MAJOR) +WL_EGL_BIN_NAME = $(WL_EGL_SO_NAME).$(WL_EGL_VERSION_MINOR).$(WL_EGL_VERSION_PATCH) SRC_DIR = ./ #CROSS_COMPILE ?= arm-none-linux-gnueabi- @@ -10,24 +11,25 @@ CFLAGS += -Wall -fno-strict-aliasing -Wno-strict-aliasing -Wno-long-long -O3 -fP WAYLAND_EGL_SRCS += \ $(SRC_DIR)/wayland-egl.c -%.o: %.c - $(TARGET_CC) -c -o $@ $< $(CFLAGS) - WAYLAND_EGL_OBJS := $(WAYLAND_EGL_SRCS:.c=.o) -libwayland-egl.so.$(WL_EGL_SO_VER): $(WAYLAND_EGL_OBJS) - $(TARGET_CC) -shared -o $@ $(WAYLAND_EGL_OBJS) $(CFLAGS) +all: $(WL_EGL_BIN_NAME) + +$(WL_EGL_BIN_NAME) : $(WAYLAND_EGL_OBJS) + $(TARGET_CC) -o $@ $(WAYLAND_EGL_OBJS) -shared -Wl,-soname,$(WL_EGL_SO_NAME) $(CFLAGS) + +%.o: %.c + $(TARGET_CC) -c -o $@ $< $(CFLAGS) .DEFAULT_GOAL = all -all: libwayland-egl.so.$(WL_EGL_SO_VER) clean: - -rm -f $(WAYLAND_EGL_OBJS) libwayland-egl.so.$(WL_EGL_SO_VER) + -rm -f $(WAYLAND_EGL_OBJS) $(WL_EGL_BIN_NAME) install: all cp ../../pkgconfig/wayland-egl.pc $(libdir)/pkgconfig/ - cp libwayland-egl.so.$(WL_EGL_SO_VER) $(libdir)/ + cp $(WL_EGL_BIN_NAME) $(libdir)/ uninstall: -rm -f $(libdir)/pkgconfig/wayland-egl.pc - -rm -f $(libdir)/libwayland-egl.so.$(WL_EGL_SO_VER) + -rm -f $(libdir)/$(WL_EGL_BIN_NAME)