SRC_DIR = ./src
+SO_NAME = libgbm.so.$(major_ver)
+BIN_NAME = $(SO_NAME).$(minor_ver)
#CROSS_COMPILE ?= arm-none-linux-gnueabi-
TARGET_CC ?= $(CROSS_COMPILE)gcc
GBM_OBJS := $(GBM_SRCS:.c=.o)
-libgbm.so: $(GBM_OBJS)
- $(TARGET_CC) -shared -o $@ $(GBM_OBJS) $(CFLAGS)
+$(BIN_NAME): $(GBM_OBJS)
+ $(TARGET_CC) -shared -Wl,-soname,$(SO_NAME) -o $@ $(GBM_OBJS) $(CFLAGS)
backend:
@for dir in $(GBM_BACKENDS_DIR) ; do \
$(MAKE) -C $$dir ; \
done
.DEFAULT_GOAL = all
-all: libgbm.so backend
+all: $(BIN_NAME) backend
clean:
- -rm -f $(GBM_OBJS) libgbm.so
+ -rm -f $(GBM_OBJS) $(BIN_NAME)
@for dir in $(GBM_BACKENDS_DIR) ; do \
$(MAKE) $@ -C $$dir ; \
done
cp $(SRC_DIR)/common.h $(includedir)/gbm/
cp $(SRC_DIR)/gbmint.h $(includedir)/gbm/
cp pkgconfig/gbm.pc $(libdir)/pkgconfig/
- cp libgbm.so $(libdir)/
+ cp $(BIN_NAME) $(libdir)/
@for dir in $(GBM_BACKENDS_DIR) ; do \
$(MAKE) $@ -C $$dir ; \
done
-rm -f $(includedir)/gbm/common.h
-rm -f $(includedir)/gbm/gbmint.h
-rm -f $(libdir)/pkgconfig/gbm.pc
- -rm -f $(libdir)/libgbm.so
+ -rm -f $(libdir)/$(BIN_NAME)
@for dir in $(GBM_BACKENDS_DIR) ; do \
$(MAKE) $@ -C $$dir ; \
done
-Summary: Wayland GBM for TIZEN
-Name: libgbm
-Version: 1.0.0s
-Release: 1
-Group: System/Libraries
-License: MIT
-
-Source0: %{name}.tar.gz
-
-# Requirements
-BuildRequires: autoconf
-BuildRequires: libtool
-BuildRequires: systemd-devel
-BuildRequires: pkgconfig(libudev)
-BuildRequires: libdrm-devel
+%define MAJOR_VER 1
+%define MINOR_VER 0s
+
+Summary: Wayland GBM for TIZEN
+Name: libgbm
+Version: %{MAJOR_VER}.%{MINOR_VER}
+Release: 1
+Group: System/Libraries
+License: MIT
+Source: %{name}-%{version}.tar.gz
+
+BuildRequires: autoconf
+BuildRequires: libtool
+BuildRequires: systemd-devel
+BuildRequires: pkgconfig(libudev)
+BuildRequires: libdrm-devel
%description
Wayland Generic Buffer Management for TIZEN
%build
make clean
-make libdir=%{_libdir}
+make libdir=%{_libdir} major_ver=%{MAJOR_VER} minor_ver=%{MINOR_VER}
%install
mkdir -p %{buildroot}%{_includedir}
mkdir -p %{buildroot}%{_libdir}/pkgconfig
-%makeinstall
+%makeinstall major_ver=%{MAJOR_VER} minor_ver=%{MINOR_VER}
+
+ln -sf libgbm.so.%{MAJOR_VER}.%{MINOR_VER} %{buildroot}%{_libdir}/libgbm.so.%{MAJOR_VER}
+ln -sf libgbm.so.%{MAJOR_VER} %{buildroot}%{_libdir}/libgbm.so
%post -p /sbin/ldconfig
%manifest packaging/libgbm.manifest
%defattr(-,root,root,-)
%{_libdir}/libgbm.so
+%{_libdir}/libgbm.so.%{MAJOR_VER}
+%{_libdir}/libgbm.so.%{MAJOR_VER}.%{MINOR_VER}
%files devel
%defattr(-,root,root,-)